/* ========================================
   Login Page - White Clean Style with Animations
   ======================================== */

/* ---- Page Background ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Animated Background Circles ---- */
.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: circleFadeIn 1.5s ease forwards;
    pointer-events: none;
}
.bg-circle.c1 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
    top: -80px; left: -80px;
    animation-delay: 0.3s;
}
.bg-circle.c2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
    bottom: -120px; right: -100px;
    animation-delay: 0.6s;
}
.bg-circle.c3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(16,185,129,0.04) 0%, transparent 70%);
    top: 40%; right: 10%;
    animation-delay: 0.9s;
}

/* ---- Login Container ---- */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---- Login Card ---- */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid rgba(229,231,235,0.5);
    animation: none;
}

/* ---- Header ---- */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    opacity: 0;
    transform: scale(0.5);
    box-shadow: 0 4px 15px rgba(59,130,246,0.3);
    position: relative;
    z-index: 1;
}

.login-icon-ring {
    position: absolute;
    width: 56px; height: 56px;
    border-radius: 14px;
    border: 2px solid rgba(59,130,246,0.2);
    opacity: 0;
    animation: ringPulse 2s ease infinite 1s;
    pointer-events: none;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    opacity: 0;
    transform: translateY(-10px);
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    opacity: 0;
    transform: translateY(-8px);
}

/* ---- Form Fields ---- */
.form-field {
    margin-bottom: 16px;
    opacity: 0;
    transform: translateX(-15px);
}

.form-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.form-check-label {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
}

/* ---- Input Fields ---- */
.form-control {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    width: 100%;
    font-size: 13px;
    color: #1f2937;
    height: calc(2.4rem + 2px);
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: #d1d5db;
    font-size: 13px;
}

.form-control:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    outline: none;
}

.input-validation-error {
    border-color: #ef4444 !important;
}
.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}

.field-validation-error {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.validation-summary-errors {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
    padding: 8px;
    background: #fef2f2;
    border-radius: 6px;
    border: 1px solid #fee2e2;
    opacity: 0;
    transform: translateY(-8px);
}

/* ---- Password Input ---- */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 40px;
}

.btn-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px 10px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.15s;
}

.btn-password-toggle:hover {
    color: #6b7280;
}

/* ---- Remember Me Checkbox ---- */
.form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* ---- Forgot Password Link ---- */
.forgot-link {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.15s;
}

.forgot-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* ---- Login Button ---- */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    height: calc(2.4rem + 6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59,130,246,0.35);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Button loading state */
.btn-login.is-loading {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spinRotate 0.7s linear infinite;
}

.btn-loading-text {
    font-size: 14px;
}

/* ---- Login Links ---- */
.login-links {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 16px;
    opacity: 0;
}

.login-links a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: color 0.15s;
}

.login-links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* ---- Footer ---- */
.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 11px;
    color: #d1d5db;
    opacity: 0;
}

/* ========================================
   Keyframe Animations
   ======================================== */

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes iconPop {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideRight {
    from { opacity: 0; transform: translateX(-15px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes circleFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes ringPulse {
    0%   { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

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

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Error shake animation for invalid form */
.form-field.has-error {
    animation: shakeError 0.4s ease;
}

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

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px 22px;
        border-radius: 12px;
        border: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .login-container {
        padding: 16px;
    }

    .login-title {
        font-size: 20px;
    }
}
