/**
 * Login / Register Page Styles
 * Branded auth experience for Comfy Languages
 *
 * @package ComfyLanguages
 * @version 1.0.0
 */

/* ==========================================================================
   Auth Page Layout
   ========================================================================== */

/* Reset all parent containers so auth page can go full-width */
.woocommerce-account .container:has(.cl-auth-page) {
    max-width: none;
    padding: 0;
    display: block;
}

.woocommerce-account .woocommerce:has(.cl-auth-page) {
    max-width: none;
    display: block !important;
    padding: 0;
}

/* Hide nav sidebar on auth pages (login, lost-password, reset-password) */
.woocommerce-account .woocommerce:has(.cl-auth-page) .woocommerce-MyAccount-navigation {
    display: none !important;
}

.woocommerce-account .woocommerce:has(.cl-auth-page) .woocommerce-MyAccount-content {
    width: 100% !important;
    max-width: none;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: auto;
}

.woocommerce-account .cl-page-content:has(.cl-auth-page) {
    padding: 0;
}

.woocommerce-account .entry-content:has(.cl-auth-page) {
    max-width: none;
}

.cl-auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding: 2rem 1rem;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
}

.cl-auth-container {
    width: 100%;
    max-width: 460px;
}

/* ==========================================================================
   Branding Header
   ========================================================================== */

.cl-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cl-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #0000ac;
}

.cl-auth-logo img {
    max-height: 40px;
    width: auto;
}

.cl-auth-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6ee4d0, #9999ff);
    color: #0000ac;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.cl-auth-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0000ac;
}

/* ==========================================================================
   Auth Tabs
   ========================================================================== */

.cl-auth-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    border-bottom: none;
}

.cl-auth-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: #f8fafc;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cl-auth-tab:hover {
    background: #f1f5f9;
    color: #0000ac;
}

.cl-auth-tab--active {
    background: white;
    color: #0000ac;
}

.cl-auth-tab--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6ee4d0, #9999ff);
}

/* ==========================================================================
   Auth Card
   ========================================================================== */

.cl-auth-panel {
    display: none;
}

.cl-auth-panel--active {
    display: block;
}

.cl-auth-card {
    background: white;
    border-radius: 0 0 12px 12px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    border-top: none;
}

/* When no tabs (registration disabled), card gets full border radius */
.cl-auth-panel:only-of-type .cl-auth-card {
    border-radius: 12px;
    border-top: 2px solid #e2e8f0;
}

.cl-auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cl-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0000ac;
    margin-bottom: 0.5rem;
}

.cl-auth-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.cl-form-group {
    margin-bottom: 1.25rem;
}

.cl-form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.cl-required {
    color: #dc2626;
}

.cl-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #1e293b;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.cl-form-input::placeholder {
    color: #94a3b8;
}

.cl-form-input:focus {
    outline: none;
    border-color: #9999ff;
    box-shadow: 0 0 0 3px rgba(153, 153, 255, 0.15);
}

.cl-form-input:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* Password field with toggle */
.cl-password-wrapper {
    position: relative;
}

.cl-password-wrapper .cl-form-input {
    padding-right: 3rem;
}

.cl-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cl-password-toggle:hover {
    color: #0000ac;
}

/* Remember me / Forgot password row */
.cl-form-row--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cl-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
}

.cl-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0000ac;
    cursor: pointer;
}

.cl-forgot-link {
    font-size: 0.9rem;
    color: #0000ac;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.cl-forgot-link:hover {
    color: #9999ff;
    text-decoration: underline;
}

/* Form note */
.cl-form-note {
    font-size: 0.875rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.cl-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #0000ac;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.cl-btn-primary:hover {
    background: #000088;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 172, 0.25);
}

.cl-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    color: #0000ac;
    border: 2px solid #0000ac;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.cl-btn-secondary:hover {
    background: #f0f5ff;
    transform: translateY(-1px);
}

.cl-btn-full {
    width: 100%;
}

.cl-btn-campus {
    margin-top: 0;
}

/* ==========================================================================
   Divider
   ========================================================================== */

.cl-auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.cl-auth-divider::before,
.cl-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.cl-auth-divider span {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 500;
}

/* ==========================================================================
   Trust Badges
   ========================================================================== */

.cl-auth-trust {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.cl-auth-trust-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.cl-auth-trust-item svg {
    color: #6ee4d0;
    flex-shrink: 0;
}

/* ==========================================================================
   WooCommerce Error/Notice Overrides
   ========================================================================== */

/* Apply to notices everywhere on the my-account page (not just inside .cl-auth-page)
   because WooCommerce renders its notices above the template, outside our wrapper. */
.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info,
.cl-auth-page .woocommerce-error,
.cl-auth-page .woocommerce-message,
.cl-auth-page .woocommerce-info {
    width: 100%;
    max-width: 460px;
    margin: 1rem auto 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.92rem;
    list-style: none;
    border: none;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    position: relative;
}

/* Remove WC default left-bar / icons that clash with our style */
.woocommerce-account .woocommerce-error::before,
.woocommerce-account .woocommerce-message::before,
.woocommerce-account .woocommerce-info::before,
.cl-auth-page .woocommerce-error::before,
.cl-auth-page .woocommerce-message::before,
.cl-auth-page .woocommerce-info::before {
    display: none !important;
    content: none !important;
}

.woocommerce-account .woocommerce-error,
.cl-auth-page .woocommerce-error {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

.woocommerce-account .woocommerce-message,
.cl-auth-page .woocommerce-message {
    background: #d2fbf3;
    border-left-color: #6ee4d0;
    color: #065f46;
}

.woocommerce-account .woocommerce-info,
.cl-auth-page .woocommerce-info {
    background: #e6ecff;
    border-left-color: #0000ac;
    color: #0000ac;
}

/* On auth page, drop the auto-centering so it aligns flush with the auth card */
.cl-auth-page .woocommerce-error,
.cl-auth-page .woocommerce-message,
.cl-auth-page .woocommerce-info {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .cl-auth-page {
        padding: 1rem 0.75rem;
        align-items: flex-start;
    }

    .cl-auth-card {
        padding: 1.5rem 1.25rem;
    }

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

    .cl-auth-trust {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .cl-form-row--between {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Auth Footer (back to login link) */
.cl-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.cl-auth-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #0000ac;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.cl-auth-footer a:hover {
    color: #9999ff;
}

/* Auth Card Header for lost/reset password */
.cl-auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cl-auth-card-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0000ac;
    margin: 0 0 0.5rem;
}

.cl-auth-card-header p {
    color: #64748b;
    font-size: 0.9375rem;
    margin: 0;
}

/* Reset password form inputs */
.woocommerce-ResetPassword .form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.woocommerce-ResetPassword .form-row input[type="text"],
.woocommerce-ResetPassword .form-row input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1e293b;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.woocommerce-ResetPassword .form-row input:focus {
    outline: none;
    border-color: #9999ff;
    box-shadow: 0 0 0 3px rgba(153, 153, 255, 0.15);
}

.woocommerce-ResetPassword .button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem;
    background: #0000ac;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.woocommerce-ResetPassword .button:hover {
    background: #000088;
}

/* ==========================================================================
   Lost Password — Confirmation Page (?reset-link-sent=true)
   WooCommerce renders a generic notice + paragraph; we restyle it.
   ========================================================================== */

.woocommerce-account .woocommerce-message {
    max-width: 440px;
    margin: 0 auto 1rem;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.woocommerce-account .woocommerce-message::before {
    content: none;
}

/* The paragraph that follows the notice */
.woocommerce-account .woocommerce-MyAccount-content > p {
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 172, 0.06);
    border: 1px solid #eef0f6;
}

/* Center the whole content area for this page */
.woocommerce-account .woocommerce-MyAccount-content:has(> .woocommerce-message) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 2rem 1rem;
}
