/* ─── Login Page ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #00baff;
    --primary-dark:  #0066cc;
    --primary-light: #e8f4ff;
    --text-dark:     #1a2b4a;
    --text-muted:    #6b7a99;
    --border:        rgba(0, 186, 255, 0.25);
    --shadow-card:   0 20px 60px rgba(0, 102, 204, 0.18);
    --radius-card:   24px;
    --radius-input:  12px;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0eeff 50%, #d0e8ff 100%);
    overflow-x: hidden;
}

/* ── Animated background circles ───────────────────────────────────────── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
    animation: floatCircle 20s ease-in-out infinite;
}

.circle-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #00baff, transparent);
    top: -180px; left: -180px;
    animation-delay: 0s;
}
.circle-2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, #0066cc, transparent);
    bottom: -120px; right: -120px;
    animation-delay: -7s;
}
.circle-3 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, #00baff, transparent);
    top: 40%; right: 10%;
    animation-delay: -13s;
}
.circle-4 {
    width: 180px; height: 180px;
    background: radial-gradient(circle, #0066cc, transparent);
    bottom: 15%; left: 8%;
    animation-delay: -4s;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -40px) scale(1.05); }
    66%       { transform: translate(-20px, 25px) scale(0.97); }
}

/* ── Card wrapper ──────────────────────────────────────────────────────── */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-card);
    padding: 2.8rem 2.5rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 28px 72px rgba(0, 102, 204, 0.24);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 186, 255, 0.3));
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.08) rotate(4deg);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Error / flash ──────────────────────────────────────────────────────── */
.alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff1f1;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #b91c1c;
    font-weight: 500;
}

.alert-error i {
    flex-shrink: 0;
    font-size: 1rem;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.field-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--primary);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}

.field-input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 2.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.7);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s;
    outline: none;
}

.field-input::placeholder {
    color: #aab0c0;
    font-weight: 400;
}

.field-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 186, 255, 0.15);
}

.field-input:focus ~ .field-icon,
.field-input-wrapper:focus-within .field-icon {
    color: var(--primary-dark);
}

/* ── Show password toggle ─────────────────────────────────────────────── */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.4rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.toggle-password:hover {
    color: var(--primary-dark);
    background: rgba(0, 186, 255, 0.1);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Forgot password ─────────────────────────────────────────────────── */
.forgot-row {
    text-align: right;
    margin-top: -0.4rem;
}

.forgot-link {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Submit button ───────────────────────────────────────────────────── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    margin-top: 0.4rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-input);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-login:hover::before {
    transform: translateX(100%);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 102, 204, 0.38);
    filter: brightness(1.05);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 186, 255, 0.15);
}

.back-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.back-link i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: var(--primary-dark);
}

.back-link:hover i {
    transform: translateX(-3px);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-logo {
        width: 68px;
        height: 68px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 1rem;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
    }
}

/* ─── Auth pages (forgot / reset password) ──────────────────────────────── */

/* Circular icon badge replacing the logo on auth pages */
.auth-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.28);
    animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-icon-wrapper i {
    font-size: 1.6rem;
    color: #fff;
}

@keyframes iconPop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ── Password strength bar ──────────────────────────────────────────────── */
.password-strength {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.strength-track {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 10px;
    background: #ef4444;
    transition: width 0.35s ease, background 0.35s ease;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
    transition: color 0.3s;
}

/* ── Confirm match hint ─────────────────────────────────────────────────── */
.match-hint {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.4rem;
    min-height: 1rem;
    transition: color 0.2s;
}

.match-ok  { color: #16a34a; }
.match-err { color: #ef4444; }

/* Disable state for submit button when passwords don't match */
.btn-login:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}
