/* Timika Auth — Login & Register */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.timika-auth-page {
    margin: 0 !important;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    direction: rtl;
    background: #f1f5f9 !important;
    font-family: inherit;
    position: relative;
    overflow-x: hidden;
    padding: 16px;
}

body.timika-auth-page .auth-wrapper,
body.timika-auth-page .register-wrapper,
body.timika-auth-page .bg-elements,
body.timika-auth-page .bg-animation {
    display: none !important;
}

/* ── پس‌زمینه روشن هماهنگ با باکس ── */
.auth-page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 45%, #eef2ff 100%);
}

.auth-bg-base {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 85% 70% at 50% 48%, rgba(255, 255, 255, 0.95) 0%, transparent 62%),
        radial-gradient(ellipse 55% 45% at 12% 18%, rgba(var(--auth-primary-rgb, 33, 150, 243), 0.14) 0%, transparent 58%),
        radial-gradient(ellipse 50% 42% at 88% 82%, rgba(var(--auth-primary-rgb, 33, 150, 243), 0.1) 0%, transparent 55%),
        linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
    animation: authBgDrift 20s ease-in-out infinite alternate;
}

.auth-bg-mesh {
    position: absolute;
    inset: 0;
}

.auth-mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    will-change: transform;
}

.auth-mesh-blob--1 {
    width: min(50vw, 380px);
    height: min(50vw, 380px);
    top: -8%;
    right: -5%;
    background: rgba(var(--auth-primary-rgb, 33, 150, 243), 0.18);
    animation: authMeshFloat1 24s ease-in-out infinite;
}

.auth-mesh-blob--2 {
    width: min(42vw, 300px);
    height: min(42vw, 300px);
    bottom: -6%;
    left: -4%;
    background: rgba(var(--auth-primary-rgb, 33, 150, 243), 0.12);
    animation: authMeshFloat2 28s ease-in-out infinite;
}

.auth-mesh-blob--3 {
    width: min(28vw, 200px);
    height: min(28vw, 200px);
    top: 50%;
    left: 42%;
    background: rgba(99, 102, 241, 0.08);
    animation: authMeshFloat3 21s ease-in-out infinite;
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--auth-primary-rgb, 33, 150, 243), 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--auth-primary-rgb, 33, 150, 243), 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 5%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 5%, transparent 72%);
    opacity: 0.7;
}

.auth-bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

.auth-bg-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 48% at 50% 50%, rgba(var(--auth-primary-rgb, 33, 150, 243), 0.07) 0%, transparent 68%),
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 50%, rgba(148, 163, 184, 0.06) 100%);
}

.auth-bg-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 45%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0.5) 55%,
        transparent 100%
    );
    background-size: 220% 220%;
    animation: authBgShine 14s ease-in-out infinite;
    opacity: 0.45;
}

@keyframes authBgDrift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.06) translate(-2%, 1%); }
}

@keyframes authMeshFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-4%, 6%) scale(1.05); }
    66% { transform: translate(3%, -4%) scale(0.96); }
}

@keyframes authMeshFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, -5%) scale(1.08); }
}

@keyframes authMeshFloat3 {
    0%, 100% { transform: translate(0, 0); opacity: 1; }
    50% { transform: translate(-5%, 3%); opacity: 0.65; }
}

@keyframes authBgShine {
    0%, 100% { background-position: 0% 50%; opacity: 0.5; }
    50% { background-position: 100% 50%; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-bg-base,
    .auth-mesh-blob,
    .auth-bg-shine {
        animation: none !important;
    }
}

/* Shell layout */
.auth-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
    width: 100%;
    max-width: 920px;
    min-height: min(600px, calc(100vh - 32px));
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(var(--auth-primary-rgb, 33, 150, 243), 0.12);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 4px 6px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.06),
        0 16px 40px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.12),
        0 32px 64px rgba(15, 23, 42, 0.06);
    animation: authShellIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    background: #fff;
}

@keyframes authShellIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand panel */
.auth-brand {
    position: relative;
    background: linear-gradient(
        155deg,
        var(--auth-primary, #2196F3) 0%,
        rgba(var(--auth-primary-rgb, 33, 150, 243), 0.88) 45%,
        #818cf8 75%,
        #e0e7ff 100%
    );
    color: #fff;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.auth-brand-logo img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
}

.auth-brand-logo i {
    font-size: 32px;
    color: #fff;
}

.auth-brand h1 {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.auth-brand-tagline {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0 0 32px;
    line-height: 1.6;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    opacity: 0.92;
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.75rem;
    opacity: 0.55;
}

/* Form panel */
.auth-panel {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.auth-panel-header {
    padding: 28px 32px 0;
    flex-shrink: 0;
}

.auth-panel-body {
    flex: 1;
    padding: 20px 32px 12px;
    overflow-y: auto;
    min-height: 0;
}

.auth-panel-body::-webkit-scrollbar { width: 5px; }
.auth-panel-body::-webkit-scrollbar-thumb {
    background: rgba(var(--auth-primary-rgb, 33, 150, 243), 0.35);
    border-radius: 4px;
}

.auth-panel-footer {
    padding: 12px 32px 28px;
    flex-shrink: 0;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.auth-form-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.auth-form-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Step navigation */
.auth-step-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 14px;
}

.auth-step-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    border-radius: 10px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.auth-step-pill .pill-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

.auth-step-pill.active {
    background: #fff;
    color: var(--auth-primary, #2196F3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-step-pill.active .pill-num {
    background: var(--auth-primary, #2196F3);
    color: #fff;
}

.auth-step-pill.done {
    color: #22c55e;
}

.auth-step-pill.done .pill-num {
    background: #dcfce7;
    color: #16a34a;
}

.auth-step-nav.hidden {
    display: none;
}

/* Progress (register) */
.auth-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.auth-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--auth-primary, #2196F3), #6366f1);
    border-radius: 4px;
    transition: width 0.35s ease;
}

/* Form elements */
.form-container {
    text-align: right;
}

.auth-step {
    display: none;
    animation: authFadeIn 0.35s ease;
}

.auth-step.active {
    display: block;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
}

.input-wrapper {
    position: relative;
    background: #f8fafc;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    transition: all 0.22s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--auth-primary, #2196F3);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.1);
}

.input-wrapper i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.22s ease;
    z-index: 2;
    pointer-events: none;
}

.input-wrapper:focus-within i {
    color: var(--auth-primary, #2196F3);
}

.form-control {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #0f172a;
    font-family: inherit;
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-control[readonly],
.form-control:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.input-type-indicator {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    transition: color 0.22s ease;
}

.input-wrapper:focus-within .input-type-indicator {
    color: var(--auth-primary, #2196F3);
}

.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    z-index: 3;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: var(--auth-primary, #2196F3);
    background: rgba(var(--auth-primary-rgb, 33, 150, 243), 0.08);
}

.password-toggle i { pointer-events: none; }

/* Buttons */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--auth-primary, #2196F3), #6366f1);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 14px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.35);
}

.submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.4);
}

.submit-btn:hover:not(:disabled)::after {
    transform: translateX(100%);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn .btn-text { transition: opacity 0.3s ease; }

.submit-btn .loading {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.back-btn {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.back-btn:hover {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.button-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
}

.button-row .back-btn {
    width: auto;
    flex: 0 0 auto;
    margin-top: 0;
}

.button-row .submit-btn {
    flex: 1;
}

/* User found */
.user-found-box {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
}

.user-found-box .user-found-title {
    color: #166534;
    font-size: 0.875rem;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
}

.user-found-box .user-found-title i { color: #22c55e; }

.user-found-box .found-username-inline {
    color: var(--auth-primary, #2196F3);
    font-weight: 800;
}

.user-found-box .login-method-prompt {
    color: #64748b;
    font-size: 0.8rem;
    margin: 0;
}

.change-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.change-user-btn:hover {
    color: var(--auth-primary, #2196F3);
    border-color: var(--auth-primary, #2196F3);
}

.login-method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.login-method-grid .submit-btn {
    padding: 14px 10px;
    font-size: 0.8rem;
    flex-direction: column;
    gap: 6px;
    box-shadow: none;
}

.login-method-grid .submit-btn i { font-size: 1.2rem; }

.login-method-grid #loginWithPasswordBtn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.login-method-grid #loginWithOTPBtn {
    background: linear-gradient(135deg, #059669, #10b981);
}

/* Checkbox & remember */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.custom-checkbox.checked {
    background: var(--auth-primary, #2196F3);
    border-color: var(--auth-primary, #2196F3);
}

.custom-checkbox i {
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.custom-checkbox.checked i { opacity: 1; }

.forgot-password {
    color: var(--auth-primary, #2196F3);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.forgot-password:hover { text-decoration: underline; }

/* OTP */
.otp-section { margin-top: 8px; }

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 8px;
    direction: ltr !important;
}

.otp-input {
    width: 46px;
    height: 52px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
    color: #0f172a;
}

.otp-input:focus {
    border-color: var(--auth-primary, #2196F3);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.1);
}

.otp-timer {
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    margin: 8px 0;
}

.resend-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: var(--auth-primary, #2196F3);
    padding: 11px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.resend-btn:hover:not(:disabled) {
    border-color: var(--auth-primary, #2196F3);
    background: rgba(var(--auth-primary-rgb, 33, 150, 243), 0.05);
}

.resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer links */
.auth-switch-link {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-switch-link a {
    color: var(--auth-primary, #2196F3);
    text-decoration: none;
    font-weight: 700;
    margin-right: 4px;
}

.auth-switch-link a:hover { text-decoration: underline; }

.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span { padding: 0 12px; }

.recruitment-auth-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.recruitment-auth-footer > span {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-bottom: 8px;
}

.recruitment-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.recruitment-auth-btn:hover {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    transform: translateY(-1px);
}

.recruitment-auth-footer .hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Register extras */
.terms-section {
    margin: 16px 0;
    text-align: right;
}

.checkbox-label {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    cursor: pointer;
    margin: 0;
}

.checkbox-label a {
    color: var(--auth-primary, #2196F3);
    text-decoration: none;
    font-weight: 600;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strength-bar.strength-weak { width: 25%; background: #ef4444; }
.strength-bar.strength-fair { width: 50%; background: #f59e0b; }
.strength-bar.strength-good { width: 75%; background: #3b82f6; }
.strength-bar.strength-strong { width: 100%; background: #22c55e; }

.password-strength-meter {
    margin-top: 10px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-fill.weak { background: linear-gradient(90deg, #ef4444, #f97316); width: 25%; }
.strength-fill.fair { background: linear-gradient(90deg, #f97316, #eab308); width: 50%; }
.strength-fill.good { background: linear-gradient(90deg, #eab308, #14b8a6); width: 75%; }
.strength-fill.strong { background: linear-gradient(90deg, #14b8a6, #22c55e); width: 100%; }

.strength-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin-top: 6px;
}

.strength-text.weak { color: #ef4444; }
.strength-text.fair { color: #f97316; }
.strength-text.good { color: #eab308; }
.strength-text.strong { color: #22c55e; }

.password-requirements {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.requirement:last-child { margin-bottom: 0; }

.password-match {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 8px;
}

.password-match.match {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.password-match.no-match {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.progress-bar { display: none; }
.progress-fill { display: none; }

/* Security alerts */
.security-alert {
    display: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    animation: authShake 0.5s ease, authFadeIn 0.3s ease;
}

.security-alert.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.security-alert.locked {
    background: linear-gradient(135deg, #64748b, #475569);
}

.security-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-alert-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.security-alert-icon i { color: #fff; font-size: 1.1rem; }

.security-alert-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.security-alert-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
}

.attempts-counter {
    display: none;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.attempts-counter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attempts-text {
    font-size: 0.8rem;
    color: #9a3412;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attempts-dots {
    display: flex;
    gap: 5px;
}

.attempt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fdba74;
    transition: background 0.3s ease;
}

.attempt-dot.used { background: #ef4444; }

.lockout-timer {
    display: none;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid #334155;
}

.lockout-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    animation: authPulse 2s ease infinite;
}

.lockout-icon i { font-size: 1.6rem; color: #fff; }

.lockout-title {
    color: #f87171;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.lockout-message {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 18px;
    line-height: 1.6;
}

.lockout-countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.countdown-item {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 68px;
}

.countdown-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f87171;
    display: block;
}

.countdown-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

.lockout-progress {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    height: 5px;
    overflow: hidden;
}

.lockout-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    border-radius: 8px;
    transition: width 1s linear;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@keyframes authPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Forgot modal */
.forgot-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    animation: authFadeIn 0.3s ease;
    overflow-y: auto;
    padding: 30px 16px;
}

.forgot-modal-content {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    position: relative;
    animation: authShellIn 0.35s ease;
    margin: auto;
}

.forgot-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.forgot-modal-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.forgot-modal-close i { color: #64748b; }

.forgot-header {
    text-align: center;
    margin-bottom: 24px;
}

.forgot-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--auth-primary, #2196F3), #6366f1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(var(--auth-primary-rgb, 33, 150, 243), 0.3);
}

.forgot-icon i { color: #fff; font-size: 1.6rem; }

.forgot-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.forgot-header p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.forgot-step { animation: authFadeIn 0.3s ease; }

/* SweetAlert */
.swal2-popup { border-radius: 20px !important; }
.swal2-title { font-weight: 700 !important; }
.swal2-confirm {
    background: var(--auth-primary, #2196F3) !important;
    border-radius: 10px !important;
}

/* FontAwesome fix */
i.fas, i.far, i.fab, i.fa, .fas, .far, .fab, .fa {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands' !important;
}

/* Recruitment code box (register) */
.recruitment-code-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.recruitment-code-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #047857;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.recruitment-code-box .recruitment-code-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.recruitment-code-box .recruitment-code-row .form-control {
    flex: 1;
    min-width: 200px;
    direction: ltr;
    text-align: left;
    text-transform: uppercase;
}

.recruitment-code-box .recruitment-code-row .submit-btn {
    width: auto;
    margin: 0;
    padding: 12px 20px;
    flex-shrink: 0;
}

.recruitment-code-box .recruitment-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 10px 0 0;
}

/* Legacy class aliases */
.register-link, .login-link {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

.register-link a, .login-link a {
    color: var(--auth-primary, #2196F3);
    text-decoration: none;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    body.timika-auth-page {
        padding: 12px;
        align-items: flex-start;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .auth-shell {
        max-width: 100%;
        width: 100%;
        border-radius: 20px;
        min-height: auto;
        margin: 0;
    }

    .auth-brand {
        padding: 20px 20px 16px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 4px 14px;
        align-items: center;
    }

    .auth-brand-inner {
        display: contents;
    }

    .auth-brand-logo {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        margin: 0;
        grid-row: 1 / span 2;
    }

    .auth-brand-logo img {
        max-width: 32px;
        max-height: 32px;
    }

    .auth-brand h1 {
        font-size: 1.15rem;
        margin: 0;
        align-self: end;
    }

    .auth-brand-tagline {
        margin: 0;
        font-size: 0.78rem;
        opacity: 0.9;
        align-self: start;
        line-height: 1.4;
    }

    .auth-features {
        display: none;
        grid-column: 1 / -1;
        margin-top: 12px;
        gap: 8px;
    }

    .auth-brand-footer {
        display: none;
    }

    .auth-panel {
        max-height: none;
    }

    .auth-panel-header {
        padding: 20px 20px 0;
    }

    .auth-panel-body {
        padding: 14px 20px 8px;
        max-height: none;
        overflow: visible;
    }

    .auth-panel-footer {
        padding: 10px 20px 20px;
    }

    .auth-form-title {
        font-size: 1.15rem;
    }

    .auth-form-desc {
        font-size: 0.82rem;
        margin-bottom: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .login-method-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .login-method-grid .submit-btn {
        padding: 12px 6px;
        font-size: 0.72rem;
    }

    .auth-step-nav {
        margin-bottom: 14px;
    }

    .auth-step-pill {
        font-size: 0.8rem;
        padding: 9px 6px;
    }

    .button-row {
        flex-direction: column;
    }

    .button-row .back-btn,
    .button-row .submit-btn {
        width: 100%;
    }

    .recruitment-auth-btn {
        font-size: 0.8rem;
        padding: 11px 12px;
    }

    .forgot-modal {
        padding: 16px 10px;
    }

    .forgot-modal-content {
        padding: 24px 18px;
        border-radius: 20px;
    }
}

@media (max-width: 420px) {
    body.timika-auth-page {
        padding: 8px;
    }

    .auth-shell {
        border-radius: 16px;
    }

    .auth-panel-header,
    .auth-panel-body,
    .auth-panel-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .login-method-grid {
        grid-template-columns: 1fr;
    }

    .otp-inputs {
        gap: 6px;
    }

    .otp-input {
        width: 40px;
        height: 46px;
        font-size: 1.1rem;
    }

    .form-control {
        font-size: 16px;
    }

    .submit-btn {
        padding: 13px 16px;
    }

    .user-found-box {
        padding: 12px;
    }

    .auth-step-pill .pill-label {
        font-size: 0.75rem;
    }
}
