/* ============================================================
   BRPFM — Login Page  |  Luxury Dark Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold:        #c9a84c;
    --gold-light:  #e2c47a;
    --gold-dim:    rgba(201,168,76,0.15);
    --bg:          #0e0e16;
    --bg-card:     #16161f;
    --bg-input:    #1c1c28;
    --border:      rgba(201,168,76,0.25);
    --border-focus:rgba(201,168,76,0.7);
    --text:        #e8e4d9;
    --text-muted:  #7a7888;
    --error:       #e05a5a;
    --radius:      14px;
    --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---------- Body ---------- */
body {
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---------- Animated background mesh ---------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(201,168,76,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 80% 80%, rgba(201,168,76,0.05) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(30,30,50,0.8)    0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: meshShift 12s ease-in-out infinite alternate;
}

@keyframes meshShift {
    from { opacity: 0.8; transform: scale(1);    }
    to   { opacity: 1;   transform: scale(1.04); }
}

/* ---------- Wrap ---------- */
.login-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

/* ---------- Card ---------- */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 24px 64px rgba(0,0,0,0.55),
        0 4px 16px  rgba(0,0,0,0.3);

    animation: cardIn 0.55s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ---------- Logo / Brand mark ---------- */
.login-card::before {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    margin: 0 auto 28px;
}

/* ---------- Heading ---------- */
.login-card h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--text);
    margin-bottom: 8px;
    animation: fadeUp 0.5s 0.15s both;
}

.login-card .login-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    animation: fadeUp 0.5s 0.2s both;
}

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

/* ---------- Form groups ---------- */
.mb-3 {
    margin-bottom: 20px;
    animation: fadeUp 0.5s both;
}
.mb-3:nth-child(1) { animation-delay: 0.25s; }
.mb-3:nth-child(2) { animation-delay: 0.32s; }

/* ---------- Labels ---------- */
.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color var(--transition);
}

/* ---------- Inputs ---------- */
.form-control {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow   var(--transition),
        background   var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control::placeholder { color: rgba(122,120,136,0.6); }

.form-control:hover {
    border-color: rgba(201,168,76,0.3);
}

.form-control:focus {
    border-color: var(--gold);
    background: #1f1f2e;
    box-shadow: 0 0 0 3px var(--gold-dim);
}

/* label glow when sibling input is focused */
.mb-3:focus-within .form-label {
    color: var(--gold-light);
}

/* ---------- Button ---------- */
.btn-custom-gold {
    display: block;
    width: 100%;
    padding: 14px 20px;
    margin-top: 28px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #0e0e16;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        transform     var(--transition),
        box-shadow    var(--transition),
        filter        var(--transition);
    animation: fadeUp 0.5s 0.38s both;
}

/* Shimmer sweep */
.btn-custom-gold::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-custom-gold:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201,168,76,0.35);
}
.btn-custom-gold:hover::after { left: 140%; }

.btn-custom-gold:active {
    transform: translateY(0);
    filter: brightness(0.95);
    box-shadow: 0 2px 8px rgba(201,168,76,0.2);
}

/* Loading state */
.btn-custom-gold.loading {
    pointer-events: none;
    opacity: 0.75;
}
.btn-custom-gold.loading::before {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(14,14,22,0.3);
    border-top-color: #0e0e16;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* ---------- Error message ---------- */
#loginError {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--error);
    text-align: center;
    min-height: 20px;
    margin-top: 14px;
    padding: 0 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#loginError:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Divider (optional use) ---------- */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.07);
}

/* ---------- Footer link (optional) ---------- */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.login-footer a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.login-footer a:hover { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px 32px;
        border-radius: 12px;
    }
    .login-card h2 { font-size: 1.3rem; }
}

@media (max-width: 360px) {
    .login-card { padding: 28px 18px 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}