/**
 * ============================================================
 * SONIC STOREFRONT — High-Fashion Minimalist Login CSS (Zara/H&M Style)
 * ============================================================
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background-color: #f7f7f7; /* Clean, light neutral background */
    color: #111111;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ── Container ── */
.login-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Login Card (High-Fashion Flat Card) ── */
.login-card {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 48px 36px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

/* ── Logo Area ── */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    text-decoration: none;
}

.login-logo img {
    max-height: 52px;
    max-width: 180px;
    object-fit: contain;
}

.login-logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: #111111;
    letter-spacing: -1px;
}

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

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111111;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.9rem;
    color: #666666;
    margin: 0;
}

/* ── Form Fields Styling (Zara Minimalist) ── */
.lf-group {
    margin-bottom: 24px;
}

.lf-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 8px;
    text-align: right;
}

.lf-input-wrap {
    position: relative;
}

.lf-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #888888;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.lf-input {
    width: 100%;
    height: 52px;
    background: #ffffff !important;
    border: 1px solid #d1d1d1 !important;
    border-radius: 6px;
    padding: 0 46px 0 20px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #111111 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    direction: ltr;
    text-align: right;
}

.lf-input::placeholder {
    color: #aaaaaa;
    direction: rtl;
}

/* Zara-style solid black border focus */
.lf-input:focus {
    border-color: #111111 !important;
    box-shadow: inset 0 0 0 1px #111111;
}

.lf-input:focus + .lf-icon,
.lf-group:focus-within .lf-icon {
    color: #111111;
}

.lf-group:focus-within .lf-label {
    color: #111111;
}

/* Valid / Invalid States */
.lf-input.is-valid {
    border-color: #10b981 !important;
}
.lf-input.is-invalid {
    border-color: #ef4444 !important;
    background: #fff8f8 !important;
}
.lf-field-msg {
    display: none !important;
}

/* Password Toggle */
.lf-pass-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888888;
    cursor: pointer;
    padding: 4px;
    font-size: 0.92rem;
    transition: color 0.2s;
    z-index: 2;
    display: flex;
    align-items: center;
}

.lf-pass-toggle:hover {
    color: #111111;
}

/* Row (remember me + forgot) */
.lf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 10px;
    flex-wrap: wrap;
    direction: rtl;
}

/* Custom Checkbox */
.lf-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lf-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #111111;
    cursor: pointer;
    border-radius: 3px;
    border: 1px solid #d1d1d1;
    display: block !important;
}

/* Hide fallback container elements */
.lf-checkbox__box {
    display: none;
}

.lf-checkbox__label {
    font-size: 0.85rem;
    color: #555555;
    font-weight: 600;
}

/* Forgot Link */
.lf-forgot {
    font-size: 0.85rem;
    color: #111111;
    font-weight: 700;
    text-decoration: none;
}
.lf-forgot:hover {
    text-decoration: underline;
}

/* Submit Button (Solid Black Zara Button) */
.lf-btn-submit {
    position: relative;
    width: 100%;
    height: 52px;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lf-btn-submit:hover:not(:disabled) {
    background-color: #222222;
}

.lf-btn-submit:disabled {
    background-color: #cccccc;
    color: #ffffff;
    cursor: not-allowed;
}

.lf-btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.lf-btn-submit.loading .spinner { display: block; }
.lf-btn-submit.loading .btn-text { display: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Divider */
.lf-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0;
    color: #888888;
    font-size: 0.8rem;
}
.lf-divider::before,
.lf-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eaeaea;
}

/* Footer Link */
.lf-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: #555555;
}

.lf-footer a {
    color: #111111;
    font-weight: 800;
    text-decoration: none;
}
.lf-footer a:hover {
    text-decoration: underline;
}

/* Security Badge */
.lf-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    font-size: 0.75rem;
    color: #999999;
}

/* Social Icons */
.login-socials {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #d1d1d1;
    color: #555555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-icons a:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

/* Alerts */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: right;
}

.login-alert--error {
    background: #fdf2f2;
    border: 1px solid #f8b4b4;
    color: #9b1c1c;
}

.login-alert--success {
    background: #f3faf7;
    border: 1px solid #def7ec;
    color: #03543f;
}

.login-alert i { margin-top: 2px; flex-shrink: 0; }

/* Rate Limit / Lockout */
.lf-lockout {
    display: none;
    background: #fdf2f2;
    border: 1px solid #f8b4b4;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    color: #9b1c1c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.lf-lockout.show { display: block; }
.lf-lockout__timer { font-size: 1.2rem; font-weight: 900; display: block; margin-top: 4px; }

.lf-rate-warn {
    display: none;
    font-size: 0.78rem;
    color: #b45309;
    margin-top: 8px;
    text-align: center;
}
.lf-rate-warn.show { display: block; }

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }
    .login-card {
        padding: 36px 20px;
    }
}
