/* ════════════════════════════════════════════════════════════════════════════
   Auth Module Styles — exact replica of core/public/assets/css/modules/auth.css
   ════════════════════════════════════════════════════════════════════════════ */

/* Legacy wrapper (still used by some views) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.auth-bg-img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--black-rgb), 0.15);
    backdrop-filter: blur(4px) saturate(100%);
    -webkit-backdrop-filter: blur(4px) saturate(100%);
    pointer-events: none;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 20px;
    padding: 50px;
    border-radius: 32px;
    position: relative;
    z-index: 10;
    transition: var(--transition);
}

.auth-card.glassmorphism {
    background: var(--auth-card-bg, var(--bg-surface, #16191e)) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--auth-card-border, var(--border)) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
}

.auth-logo-box .icon-lg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.auth-title {
    color: var(--primary);
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.auth-alert-error {
    background: rgba(var(--danger-rgb, 239, 68, 68), 0.08);
    border: 1px solid rgba(var(--danger-rgb, 239, 68, 68), 0.2);
    color: var(--danger, #dc2626);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.auth-form {
    text-align: center;
}

.auth-form .floating-group {
    margin-bottom: 25px;
    text-align: left;
}

.auth-form .floating-group .form-control:focus ~ .floating-label,
.auth-form .floating-group .form-control:not(:placeholder-shown) ~ .floating-label {
    background: var(--auth-card-bg, var(--bg-surface)) !important;
    color: var(--primary) !important;
}

.auth-session-warn {
    background: rgba(var(--warning-rgb, 245, 158, 11), 0.1);
    border: 1px solid rgba(var(--warning-rgb, 245, 158, 11), 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
}

.auth-session-warn-text {
    color: var(--warning);
    font-size: 13px;
    margin-bottom: 15px;
    font-weight: 600;
}

.auth-captcha-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 999px;
    border: 1px solid rgba(var(--success-rgb, 34, 197, 94), 0.45);
    background: rgba(var(--black-rgb), 0.48);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-captcha-badge .icon-sm {
    width: 16px;
    height: 16px;
    color: var(--success, #22c55e);
}

.auth-captcha-badge-corner {
    position: fixed;
    right: 18px;
    bottom: 16px;
    z-index: 25;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

@media (max-width: 768px) {
    .auth-captcha-badge {
        font-size: 11px;
        padding: 9px 11px;
    }
    .auth-captcha-badge .icon-sm {
        width: 15px;
        height: 15px;
    }
    .auth-captcha-badge-corner {
        right: 12px;
        bottom: 12px;
        max-width: calc(100vw - 24px);
    }
}

/* Confirmation Page */
.confirm-card {
    background: var(--bg-card);
    padding: 50px;
    border-radius: 24px;
    text-align: center;
    max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: none !important;
}

.confirm-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon-circle.success {
    background: rgba(var(--success-rgb, 34, 197, 94), 0.1);
    color: var(--success);
    border: 2px solid rgba(var(--success-rgb, 34, 197, 94), 0.3);
}

.confirm-icon-circle.error {
    background: rgba(var(--danger-rgb, 239, 68, 68), 0.1);
    color: var(--danger);
    border: 2px solid rgba(var(--danger-rgb, 239, 68, 68), 0.3);
}

.confirm-title {
    margin-top: 0;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.confirm-text {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
}

/* Register Card */
.auth-card.register-card,
.auth-page .auth-card.register-card {
    max-width: 800px !important;
    width: 95% !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   Gentelella v4 Login Styles (auth-page layout)
   ════════════════════════════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--body-bg, #f3f4f6);
    padding: 20px;
    position: relative;
    z-index: 10;
}
[data-theme="dark"] .auth-page {
    background-color: var(--body-bg, #0f172a);
}

.auth-page .auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface, #ffffff) !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 32px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}
[data-theme="dark"] .auth-page .auth-card {
    background: var(--bg-surface, #1e293b) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -6px rgba(0, 0, 0, 0.3) !important;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}
.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary, #1ABB9C);
    color: #ffffff;
    font-weight: 800;
    font-size: 18px;
    border-radius: 8px;
    overflow: hidden;
}
.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main, var(--text, #111827));
}

.auth-page .auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main, var(--text, #111827));
    margin-bottom: 8px;
    text-align: left;
}
.auth-page .auth-subtitle {
    font-size: 14px;
    color: var(--text-muted, var(--text-secondary, #6b7280));
    margin-bottom: 24px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, var(--text, #374151));
    text-align: left;
}
.auth-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}
.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted, var(--text-secondary, #9ca3af));
    pointer-events: none;
    z-index: 10;
}
.auth-page .form-control {
    width: 100%;
    height: 38px;
    padding: 8px 12px 8px 36px !important;
    border: 1px solid var(--border, var(--border-color, #d1d5db)) !important;
    border-radius: 8px !important;
    background: var(--bg-surface, #ffffff) !important;
    color: var(--text-main, var(--text, #111827)) !important;
    font-size: 14px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}
.auth-page .form-control:focus {
    border-color: var(--primary, #1ABB9C) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(26, 187, 156, 0.15) !important;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted, var(--text-secondary, #4b5563));
}
.auth-actions a {
    color: var(--primary, #1ABB9C);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted, var(--text-secondary, #4b5563));
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 20px;
}
.auth-footer a {
    color: var(--primary, #1ABB9C);
    font-weight: 600;
    text-decoration: none;
}
[data-theme="dark"] .auth-footer {
    border-top-color: var(--border-color, #334155);
}

/* Button overrides for auth pages to remove border and green hover */
.auth-page .btn-primary, .auth-page .btn-premium,
.auth-wrapper .btn-primary, .auth-wrapper .btn-premium {
    border: none !important;
}
.auth-page .btn-primary:hover, .auth-page .btn-premium:hover,
.auth-wrapper .btn-primary:hover, .auth-wrapper .btn-premium:hover {
    background: var(--primary) !important;
    filter: brightness(0.9) !important;
}

/* Grid layout for authentication forms */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
