/* ============================================
   Authentication Form Styles
   Based on tra.css design
   ============================================ */

.modern-form {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --bg-input: #f8fafc;

    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(148, 163, 184, 0.1);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .modern-form {
    background: #1f2937;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.4),
        0 2px 4px -2px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(75, 85, 99, 0.3);
    --text-main: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-input: #374151;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 32px;
    text-align: center;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.input-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .form-input {
    border-color: rgba(75, 85, 99, 0.5);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.password-toggle {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.eye-icon {
    width: 18px;
    height: 18px;
}

.submit-button {
    position: relative;
    width: 100%;
    height: 48px;
    margin-top: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.form-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
}

.login-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
    display: inline-block;
}

.login-link span {
    color: var(--primary);
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.3s ease;
}

/* Hover & Focus States */
.form-input:hover {
    border-color: #cbd5e1;
    background: white;
}

[data-theme="dark"] .form-input:hover {
    border-color: rgba(75, 85, 99, 0.8);
    background: #4b5563;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

[data-theme="dark"] .form-input:focus {
    background: #4b5563;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.form-input:focus ~ .input-icon {
    color: var(--primary);
}

.password-toggle:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.password-toggle:active {
    transform: scale(0.95);
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow:
        0 8px 16px rgba(59, 130, 246, 0.3),
        0 4px 8px rgba(59, 130, 246, 0.2);
}

.submit-button:hover .button-glow {
    transform: translateX(100%);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow:
        0 4px 8px rgba(59, 130, 246, 0.2),
        0 2px 4px rgba(59, 130, 246, 0.15);
}

.login-link:hover {
    color: var(--text-main);
}

[data-theme="dark"] .login-link:hover {
    color: #f9fafb;
}

.login-link:hover span {
    color: var(--primary-dark);
}

/* Validation States */
.form-input:not(:placeholder-shown):valid {
    border-color: var(--success);
}

.form-input:not(:placeholder-shown):valid ~ .input-icon {
    color: var(--success);
}

/* Animation */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

.form-input:not(:placeholder-shown):invalid {
    border-color: #ef4444;
    animation: shake 0.3s ease-in-out;
}

.form-input:not(:placeholder-shown):invalid ~ .input-icon {
    color: #ef4444;
}

/* Authentication Container */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 200px);
    padding: 2rem 2rem 4rem 2rem;
    position: relative;
    z-index: 1;
}

.auth-wrapper {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Auth Page Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
    animation: iconFloat 3s ease-in-out infinite;
    position: relative;
}

.auth-header-icon svg {
    width: 32px;
    height: 32px;
    color: white;
    animation: iconPulse 2.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(-2deg);
    }
    75% {
        transform: scale(1.05) rotate(2deg);
    }
}

.auth-header-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: color 0.3s ease;
}

[data-theme="dark"] .auth-header-title {
    color: #f9fafb;
}

.auth-typewriter-text {
    display: inline-block;
    min-width: 200px;
    font-size: 1rem;
    font-weight: 500;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-typewriter-text::after {
    content: '|';
    animation: blink 1s infinite;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .modern-form {
        padding: 24px;
        max-width: 100%;
    }

    .form-title {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .form-input {
        height: 44px;
        padding: 0 40px 0 40px;
    }

    .input-icon {
        width: 16px;
        height: 16px;
        left: 12px;
    }

    .password-toggle {
        right: 12px;
    }

    .eye-icon {
        width: 16px;
        height: 16px;
    }

    .submit-button {
        height: 44px;
        font-size: 14px;
    }

    .auth-container {
        padding: 1.5rem 1rem 3rem 1rem;
        min-height: calc(100vh - 150px);
    }

    .auth-header {
        margin-bottom: 2rem;
    }

    .auth-header-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.25rem;
    }

    .auth-header-icon svg {
        width: 28px;
        height: 28px;
    }

    .auth-header-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .auth-typewriter-text {
        font-size: 0.9rem;
        min-width: 180px;
    }
}

/* Auth CTA Banner Section */
.auth-cta-banner {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    padding: 2.5rem 2rem;
    margin: 0 auto -6rem;
    max-width: 800px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.auth-cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>');
    opacity: 0.3;
}

.auth-cta-banner-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-cta-banner-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-cta-banner-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Auth CTA Banner Responsive */
@media (max-width: 968px) {
    .auth-cta-banner {
        padding: 2rem 1.5rem;
        margin: 0 auto -4rem;
        max-width: calc(100% - 3rem);
    }

    .welcome-footer {
        padding-top: 6rem;
    }

    .auth-cta-banner-title {
        font-size: 1.375rem;
    }

    .auth-cta-banner-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .auth-cta-banner {
        padding: 1.75rem 1rem;
        margin: 0 auto -3.5rem;
        max-width: calc(100% - 2rem);
        border-radius: 12px;
    }

    .welcome-footer {
        padding-top: 5.5rem;
    }

    .auth-cta-banner-title {
        font-size: 1.25rem;
    }

    .auth-cta-banner-description {
        font-size: 0.8125rem;
    }
}

