/* ==========================================================================
   DínaCart Auth Modal + Wishlist — dc-auth.css v1.0.0
   ========================================================================== */

[hidden] { display: none !important; }

/* ── Backdrop ────────────────────────────────────────────────────────────── */
.dc-auth-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99996;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.dc-auth-backdrop.open { opacity: 1; pointer-events: auto; }

/* ── Modal panel ─────────────────────────────────────────────────────────── */
.dc-auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(.96);
    width: min(94vw, 420px);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--dc-bg);
    border-radius: 20px;
    z-index: 99997;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,.2);
    scrollbar-width: none;
    outline: none;
}
.dc-auth-modal::-webkit-scrollbar { display: none; }
.dc-auth-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Close button ────────────────────────────────────────────────────────── */
.dc-auth-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--dc-surface);
    color: var(--dc-text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.dc-auth-close:hover { background: var(--dc-surface-hover); color: var(--dc-text); }

/* ── Brand mark ──────────────────────────────────────────────────────────── */
.dc-auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

/* ── Title ───────────────────────────────────────────────────────────────── */
.dc-auth-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dc-text);
    text-align: center;
    margin: 0 0 20px;
    letter-spacing: -.02em;
    line-height: 1.2;
}

/* ── Social buttons ──────────────────────────────────────────────────────── */
.dc-auth-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.dc-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--dc-radius-pill);
    border: 1.5px solid var(--dc-border);
    background: var(--dc-bg);
    color: var(--dc-text);
    font: 500 14px/1 var(--dc-font);
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.dc-social-btn:hover {
    background: var(--dc-surface);
    border-color: var(--dc-text-muted);
    box-shadow: var(--dc-shadow-sm);
}
.dc-social-btn--apple { background: var(--dc-text); color: var(--dc-bg); border-color: var(--dc-text); }
.dc-social-btn--apple:hover { background: #333; border-color: #333; }
@media (prefers-color-scheme: dark) {
    .dc-social-btn--apple { background: #fff; color: #111; border-color: #fff; }
    .dc-social-btn--apple:hover { background: #e8e8e8; border-color: #e8e8e8; }
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.dc-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: var(--dc-text-muted);
    font-size: 12px;
}
.dc-auth-divider::before,
.dc-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--dc-border);
}

/* ── Message ─────────────────────────────────────────────────────────────── */
.dc-auth-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    text-align: center;
}
.dc-auth-msg--error   { background: #fef2f2; color: #dc2626; }
.dc-auth-msg--success { background: #f0fdf4; color: #16a34a; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.dc-auth-form { display: flex; flex-direction: column; gap: 14px; }

/* Field */
.dc-field { display: flex; flex-direction: column; gap: 6px; }
.dc-field__row { display: flex; align-items: center; justify-content: space-between; }
.dc-field__label { font-size: 13px; font-weight: 500; color: var(--dc-text); }
.dc-field__link  { font-size: 12px; color: var(--dc-accent); text-decoration: none; }
.dc-field__link:hover { text-decoration: underline; }

.dc-field__input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--dc-border);
    border-radius: var(--dc-radius-sm);
    background: var(--dc-bg);
    color: var(--dc-text);
    font: 400 14px/1 var(--dc-font);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.dc-field__input:focus {
    border-color: var(--dc-accent);
    box-shadow: 0 0 0 3px var(--dc-accent-soft);
}
.dc-field__input::placeholder { color: var(--dc-text-muted); }
.dc-field__input.error { border-color: #dc2626; }

/* Password toggle */
.dc-field__pw-wrap { position: relative; }
.dc-field__pw-wrap .dc-field__input { padding-right: 42px; }
.dc-field__eye {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    border: none; background: none;
    color: var(--dc-text-muted);
    cursor: pointer; display: flex; align-items: center;
    padding: 0;
    transition: color .15s;
}
.dc-field__eye:hover { color: var(--dc-text); }

/* Submit button */
.dc-auth-submit {
    position: relative;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--dc-radius-pill);
    background: var(--dc-accent);
    color: #fff;
    font: 600 15px/1 var(--dc-font);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, transform .1s;
    margin-top: 4px;
}
.dc-auth-submit:hover   { background: var(--dc-accent-hover); }
.dc-auth-submit:active  { transform: scale(.98); }
.dc-auth-submit:disabled { opacity: .6; cursor: not-allowed; }

.dc-auth-submit__spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dc-spin .7s linear infinite;
}
.dc-auth-submit.loading .dc-auth-submit__text { display: none; }
.dc-auth-submit.loading .dc-auth-submit__spinner { display: block; }

/* Switch link */
.dc-auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--dc-text-muted);
    margin: 4px 0 0;
}
.dc-auth-switch__btn {
    background: none; border: none;
    color: var(--dc-accent); font: 600 13px/1 var(--dc-font);
    cursor: pointer; padding: 0; margin-left: 4px;
    text-decoration: underline; text-underline-offset: 2px;
}
.dc-auth-switch__btn:hover { color: var(--dc-accent-hover); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dc-auth-modal { padding: 28px 20px 24px; border-radius: 20px 20px 0 0; top: auto; bottom: 0; transform: translate(-50%, 20px) scale(1); left: 50%; width: 100%; max-width: 100%; }
    .dc-auth-modal.open { transform: translate(-50%, 0) scale(1); }
}

/* ==========================================================================
   WISHLIST SAVE BUTTON STATES
   ========================================================================== */

/* Saved state — filled heart + dark bg */
.dc-card__save.saved {
    background: var(--dc-text);
    color: var(--dc-bg);
}
.dc-card__save.saved svg { fill: currentColor; }

/* Pulse animation on save */
@keyframes dc-save-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    70%  { transform: scale(.95); }
    100% { transform: scale(1); }
}
.dc-card__save.pulse { animation: dc-save-pulse .35s ease; }

/* Wishlist count badge on sidenav (future use) */
.dc-sidenav__wishlist-count {
    position: absolute;
    top: -4px; right: -6px;
    min-width: 16px; height: 16px;
    background: var(--dc-accent);
    color: #fff;
    font-size: 9px; font-weight: 700;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .dc-auth-modal, .dc-auth-backdrop,
    .dc-auth-submit__spinner, .dc-card__save { animation: none !important; transition: none !important; }
}
