/* Auth Pages Styling - Based on Astra AI but with LernexAI branding */

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #161517 100%);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.auth-container {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: minmax(min-content, 1fr) min-content minmax(min-content, 2fr);
    overflow-y: auto;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* Top gradient effect */
.auth-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    background: linear-gradient(90deg,
        rgba(139, 92, 246, 0.6) 0%,
        rgba(34, 211, 238, 0.6) 50%,
        rgba(16, 185, 129, 0.6) 100%
    );
    filter: blur(40px);
    opacity: 0.3;
    pointer-events: none;
}

/* Header with language switcher */
.auth-header {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}

.auth-language-switcher {
    display: flex;
    justify-content: flex-end;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: 1px solid #2B2C30;
    border-radius: 9999px;
    color: #a3a3a3;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.language-btn:hover {
    border-color: rgba(163, 163, 163, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.language-btn .flag {
    font-size: 1.1rem;
    line-height: 1;
}

/* Main content area */
.auth-content {
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Logo */
.auth-logo {
    width: 200%;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-logo img {
    height: 200px;
    width: auto;
}

/* Text section */
.auth-text-section {
    width: 100%;
    text-align: center;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 2rem;
    color: #fafafa;
    margin: 0 0 0.5rem 0;
}

.auth-description {
    font-size: 1rem;
    font-weight: 400;
    color: #a3a3a3;
    margin: 0;
    line-height: 1.5;
}

/* Buttons section */
.auth-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 4rem;
    padding: 1.5rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.2px;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    outline: none;
    white-space: nowrap;
}

.auth-btn svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.auth-btn-outline {
    background: transparent;
    border: 1px solid #2B2C30;
    color: #fafafa;
}

.auth-btn-outline:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.auth-btn-primary {
    background: #3A3D4D;
    color: #fafafa;
    border: none;
}

.auth-btn-primary:hover {
    background: #4A4D5D;
}

.auth-btn-submit {
    background: #5865F2;
    color: #fafafa;
    border: none;
    margin-top: 0.5rem;
}

.auth-btn-submit:hover {
    background: #4752C4;
}

.auth-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Terms text */
.auth-terms {
    width: 100%;
    text-align: center;
    padding: 0;
}

.auth-terms p {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #737373;
    margin: 0;
}

.auth-link {
    color: #fafafa;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #d4d4d4;
}

/* Form styling */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #a3a3a3;
    text-align: left;
}

.auth-input {
    width: 100%;
    height: 3.5rem;
    padding: 1rem 1.25rem;
    background: #1a1a1c;
    border: 1px solid #2B2C30;
    border-radius: 0.5rem;
    color: #fafafa;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: #525252;
}

.auth-input:focus {
    border-color: var(--primary);
    background: #1f1f21;
}

.auth-hint {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #737373;
    margin: 0;
    text-align: left;
}

/* Back link */
.auth-back {
    width: 100%;
    margin-top: -0.5rem;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #a3a3a3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: #fafafa;
}

.auth-back-link svg {
    width: 1rem;
    height: 1rem;
}

/* Error message */
.auth-error {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: #ef4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-content {
        padding: 0 1rem;
    }

    .auth-box {
        gap: 1.5rem;
    }

    .auth-logo img {
        height: 48px;
    }

    .auth-title {
        font-size: 1.125rem;
    }

    .auth-btn {
        height: 3.5rem;
        padding: 1rem 1.5rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .auth-content {
        padding: 0 1rem;
    }

    .auth-header {
        padding: 0.75rem;
    }

    .auth-box {
        gap: 1.25rem;
    }

    .auth-logo img {
        height: 40px;
    }

    .auth-title {
        font-size: 1rem;
    }

    .auth-description {
        font-size: 0.9375rem;
    }

    .auth-btn {
        height: 3rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }

    .auth-terms p {
        font-size: 0.6875rem;
    }
}

/* Light mode (if needed) */
@media (prefers-color-scheme: light) {
    .auth-body {
        background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    }

    .auth-title {
        color: #171717;
    }

    .auth-description,
    .language-btn,
    .auth-back-link {
        color: #525252;
    }

    .auth-btn-outline {
        border-color: #e5e5e5;
        color: #171717;
    }

    .auth-btn-outline:hover {
        background: rgba(139, 92, 246, 0.05);
    }

    .auth-btn-primary {
        background: #f5f5f5;
        color: #171717;
    }

    .auth-btn-primary:hover {
        background: #e5e5e5;
    }

    .auth-input {
        background: #ffffff;
        border-color: #e5e5e5;
        color: #171717;
    }

    .auth-input:focus {
        background: #fafafa;
    }

    .auth-link {
        color: #171717;
    }

    .auth-terms p,
    .auth-hint {
        color: #737373;
    }

    .language-btn {
        border-color: #e5e5e5;
    }

    .language-btn:hover {
        background: #f5f5f5;
    }
}
