/* Login Page Styles - Matching Register Page Design */

.login-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #f5f5f7;
}

/* Desktop background image - same as register page */
/* ✅ UPDATED: Uses static file directly for better reliability */
@media (min-width: 641px) {
    .login-container {
        background: 
            linear-gradient(
                135deg,
                rgba(116, 28, 71, 0.85) 0%,
                rgba(166, 77, 121, 0.75) 100%
            ),
            url('/assets/images/background.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* Desktop card styling - same as register page */
@media (min-width: 641px) {
    .login-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(0, 0, 0, 0.05);
    }
}

/* Hero Section */
.login-hero {
    margin-bottom: 24px;
    text-align: center;
}

.login-heading {
    font-size: var(--font-size-2xl);
    color: #1d1d1f;
    font-weight: 600;
    margin: 12px auto 0;
}

.login-logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
}

.login-hero p {
    font-size: 0.9375rem;
    color: #1A1A1A;
    line-height: 1.5;
    margin: 0;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    color: #6e6e73;
    font-size: 0.875rem;
    z-index: 1;
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: none;
    background: #ece8ec;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1d1d1f;
    font-family: 'Poppins', Arial, sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-weight: 500;
}

.input-with-toggle input {
    padding-right: 64px;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #1d1d1f !important;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.toggle-password-btn i {
    font-size: 1.1rem;
    pointer-events: none;
    line-height: 1;
    color: #1d1d1f !important;
}

.toggle-password-btn:hover,
.toggle-password-btn:focus-visible {
    color: #A64D79;
    background-color: rgba(166, 77, 121, 0.08);
}

.toggle-password-btn:focus {
    outline: none;
}

/* Remove autofill blue background */
.input-with-icon input:-webkit-autofill,
.input-with-icon input:-webkit-autofill:hover,
.input-with-icon input:-webkit-autofill:focus,
.input-with-icon input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ece8ec inset !important;
    -webkit-text-fill-color: #1d1d1f !important;
    background-color: #ece8ec !important;
}

.input-with-icon input:focus {
    outline: none;
    background: #e0d8e0;
}

.input-with-icon input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #e0d8e0 inset !important;
    -webkit-text-fill-color: #1d1d1f !important;
    background-color: #e0d8e0 !important;
}

.input-with-icon input::placeholder {
    color: #6e6e73;
    opacity: 0.8;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #741C47;
}

.checkbox-label span {
    color: #6e6e73;
    font-size: 0.875rem;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    border-radius: 14px;
    margin-bottom: 20px;
    animation: slideInError 0.4s ease-out;
}

.error-banner i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.error-banner span {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Button */
.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', Arial, sans-serif;
    margin-bottom: 16px;
}

.btn-primary {
    background: #741C47;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #5a1538;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f2f4;
    color: #1d1d1f;
    border: 1px solid #d8d6dc;
}

.btn-secondary:hover:not(:disabled) {
    background: #e7e4ea;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forgot Password Link */
.forgot-password-link {
    text-align: center;
    margin-top: 8px;
}

.forgot-password-link a {
    color: #741C47;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-password-link a:hover {
    color: #5a1538;
    text-decoration: underline;
}

/* Error and Success Messages */
.error-message {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.05));
    border: 2px solid #dc2626;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
    animation: slideInError 0.4s ease-out;
}

.success-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 2px solid #22c55e;
    color: #16a34a;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
    animation: slideInSuccess 0.4s ease-out;
}

@keyframes slideInSuccess {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e7;
}

.login-footer p {
    color: #1A1A1A;
    font-size: 0.875rem;
    margin: 0;
}

.login-footer a {
    color: #741C47;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    color: #5a1538;
    text-decoration: underline;
}

/* Card View Toggle */
.card-view {
    display: none;
    animation: cardFadeIn 0.25s ease;
}

.card-view-active {
    display: block;
}

.reset-form .form-group {
    margin-bottom: 16px;
}

.reset-hint {
    margin: 16px 0 0;
    color: #6e6e73;
    font-size: 0.85rem;
    line-height: 1.4;
}

.reset-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.reset-message.reset-error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #991b1b;
}

.reset-message.reset-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.reset-back-btn {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1d1d1f !important;
}

.reset-back-btn i {
    font-size: 0.9rem;
    color: #1d1d1f !important;
}

.reset-back-btn span {
    color: #1d1d1f !important;
}

.reset-back-btn:hover,
.reset-back-btn:focus-visible {
    color: #1d1d1f !important;
}

.reset-back-btn:hover i,
.reset-back-btn:focus-visible i,
.reset-back-btn:hover span,
.reset-back-btn:focus-visible span {
    color: #1d1d1f !important;
}

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

/* Button loading state */
#submit-btn {
    position: relative;
    transition: all 0.3s ease;
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom scrollbar for login card */
.login-card::-webkit-scrollbar {
    width: 8px;
}

.login-card::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 4px;
}

.login-card::-webkit-scrollbar-thumb {
    background: #86868b;
    border-radius: 4px;
}

.login-card::-webkit-scrollbar-thumb:hover {
    background: #6e6e73;
}

/* Responsive - Mobile First */
@media (max-width: 640px) {
    .login-container {
        padding: 0;
        background: #f5f5f7;
        background-attachment: scroll;
    }

    .login-card {
        border-radius: 0;
        padding: 20px;
        margin-top: 0;
        box-shadow: none;
        max-width: 100%;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
    }

    .login-logo {
        max-width: 220px;
        margin-bottom: 12px;
    }

    .login-hero p {
        font-size: 0.875rem;
    }
}
