/* ===================================
   Login Page Styles - Airbnb Inspired
   =================================== */

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px;
}

/* --- Login Container --- */
.login-container {
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Login Card --- */
.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* --- Header --- */
.login-header {
    padding: 20px 30px 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.login-logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

.login-logo i {
    font-size: 20px;
    color: white;
}

.login-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 12px;
    color: #717171;
}

/* --- Form Body --- */
.login-body {
    padding: 20px 30px 25px;
}

/* --- Form Group --- */
.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #222;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Input Styles --- */
.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background-color: #fafafa;
    transition: all 0.3s ease;
    color: #222;
}

.form-input:hover {
    border-color: #ccc;
}

.form-input:focus {
    outline: none;
    border-color: #222;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(34, 34, 34, 0.05);
}

.form-input::placeholder {
    color: #b0b0b0;
}

/* --- Input with Icon --- */
.input-wrapper {
    position: relative;
}

.input-wrapper .form-input {
    padding-left: 40px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #717171;
    font-size: 14px;
    transition: color 0.3s;
}

.input-wrapper:focus-within .input-icon {
    color: #222;
}

/* --- Password Toggle --- */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #717171;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #222;
}

/* --- Remember Me --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #484848;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #222;
    cursor: pointer;
}

.forgot-password {
    font-size: 12px;
    color: #717171;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #222;
    text-decoration: underline;
}

/* --- Submit Button --- */
.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Loading Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Divider --- */
.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #717171;
    font-size: 11px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e0e0e0;
}

.divider span {
    padding: 0 12px;
}

/* --- Social Login Buttons --- */
.social-buttons {
    display: flex;
    gap: 10px;
}

.btn-social {
    flex: 1;
    padding: 10px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    color: #222;
}

.btn-social:hover {
    background-color: #f7f7f7;
    border-color: #222;
}

.btn-social i {
    font-size: 16px;
}

.btn-social.google i { color: #EA4335; }
.btn-social.facebook i { color: #1877F2; }
.btn-social.line i { color: #00B900; }

/* --- Footer --- */
.login-footer {
    padding: 15px 30px;
    background-color: #fafafa;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.login-footer p {
    font-size: 12px;
    color: #717171;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* --- Alert Messages --- */
.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert i {
    font-size: 18px;
}

/* --- Back to Home --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 12px;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 480px) {

    .login-header {
        padding: 15px 20px 12px;
    }

    .login-body {
        padding: 15px 20px 20px;
    }

    .login-footer {
        padding: 12px 20px;
    }

    .login-title {
        font-size: 16px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-login {
        padding: 10px;
        font-size: 13px;
    }

    .social-buttons {
        flex-direction: column;
        gap: 8px;
    }
}

/* --- Input Validation States --- */
.form-input.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.form-input.success {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

.error-message {
    font-size: 12px;
    color: #dc2626;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Floating Labels (Optional) --- */
.floating-label {
    position: relative;
}

.floating-label .form-input {
    padding-top: 24px;
    padding-bottom: 8px;
}

.floating-label .form-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #717171;
    pointer-events: none;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}

.floating-label .form-input:focus + .form-label,
.floating-label .form-input:not(:placeholder-shown) + .form-label {
    top: 14px;
    font-size: 11px;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Database Status Indicator --- */
.db-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

.db-status.connected {
    background-color: #f0fdf4;
    color: #16a34a;
}

.db-status.disconnected {
    background-color: #fef2f2;
    color: #dc2626;
}

.db-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.db-status.connected .db-status-dot {
    background-color: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.db-status.disconnected .db-status-dot {
    background-color: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.db-status-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
