/* sm-auth.css — Login e registrazione · Design system SitoMatrimonio */
@import url('../fonts/sm-fonts.css');

:root {
    --white:       #FFFFFF;
    --bg:          #FBF8F4;
    --bg-mid:      #F5EFE6;
    --blush:       #F2E4DC;
    --gold:        #B8965A;
    --gold-light:  #D4B483;
    --text:        #2C2320;
    --text-mid:    #6B5B52;
    --text-muted:  #9E8E87;
    --border:      rgba(184,150,90,0.22);
    --error:       #c06060;
    --error-bg:    rgba(180,100,100,0.1);
    --success:     #5a9a54;
    --success-bg:  rgba(90,154,84,0.15);
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Auth wrapper ── */
.sm-auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Colonna sinistra — decorativa */
.sm-auth-left {
    background: var(--text);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 48px;
    position: relative; overflow: hidden;
}
.sm-auth-left::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B8965A' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.sm-auth-brand {
    position: relative; text-align: center;
}
.sm-auth-brand-icon {
    font-size: 3rem; margin-bottom: 24px; display: block;
}
.sm-auth-brand-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem; font-weight: 400;
    color: var(--white); letter-spacing: 0.02em;
    margin-bottom: 12px;
}
.sm-auth-brand-name span { color: var(--gold-light); font-style: italic; }
.sm-auth-brand-tagline {
    font-size: 0.82rem; font-weight: 400;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: 0.2em;
}
.sm-auth-brand-divider {
    width: 40px; height: 1px;
    background: var(--gold);
    margin: 24px auto;
}
.sm-auth-features {
    list-style: none; text-align: left;
    display: flex; flex-direction: column; gap: 14px;
    margin-top: 8px;
}
.sm-auth-features li {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.85rem; font-weight: 400;
    color: rgba(255,255,255,0.65);
}
.sm-auth-features li::before {
    content: '–';
    color: var(--gold-light);
    font-weight: 400;
    flex-shrink: 0;
}

/* Colonna destra — form */
.sm-auth-right {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 48px;
    background: var(--white);
}
/* Quando il form è embedded in una pagina Elementor */
.sm-auth-right.sm-auth-inline {
    padding: 0;
    background: transparent;
    align-items: flex-start;
}
.sm-auth-form-wrap {
    width: 100%; max-width: 380px;
}

/* Header form */
.sm-auth-form-header { margin-bottom: 36px; }
.sm-auth-form-eyebrow {
    font-size: 0.72rem; font-weight: 400;
    text-transform: uppercase; letter-spacing: 0.2em;
    color: var(--gold); margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
}
.sm-auth-form-eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--gold); }
.sm-auth-form-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.9rem; font-weight: 400;
    color: var(--text); line-height: 1.2;
    margin-bottom: 10px;
}
.sm-auth-form-sub {
    font-size: 0.88rem; font-weight: 400;
    color: var(--text-muted); line-height: 1.6;
}
.sm-auth-form-sub a { color: var(--gold); text-decoration: none; }
.sm-auth-form-sub a:hover { color: var(--gold-light); }

/* Form fields */
.sm-auth-field { margin-bottom: 20px; }
.sm-auth-field label {
    display: block;
    font-size: 0.72rem; font-weight: 400;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); margin-bottom: 8px;
}
.sm-auth-field input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem; font-weight: 400;
    background: var(--bg);
    color: var(--text);
    transition: all .2s;
}
.sm-auth-field input::placeholder { color: var(--text-muted); }
.sm-auth-field input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,150,90,0.1);
    background: var(--white);
}

/* CTA button */
.sm-auth-btn {
    width: 100%; padding: 0.95rem;
    background: var(--gold); color: var(--white);
    border: none; border-radius: 2px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.12em;
    cursor: pointer; transition: all .2s;
    margin-top: 8px;
}
.sm-auth-btn:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(184,150,90,0.3);
}
.sm-auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Messages */
.sm-auth-msg {
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 0.85rem; font-weight: 400;
    margin-bottom: 20px;
}
.sm-auth-msg-error   { background: var(--error-bg);   color: var(--error);   border-left: 3px solid var(--error); }
.sm-auth-msg-success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }

/* Spinner overlay */
#sm-login-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(251,248,244,.88);
    backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
    flex-direction: column; gap: 20px;
}
#sm-login-overlay.active { display: flex; }
.sm-login-spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--blush);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: sm-auth-spin .8s linear infinite;
}
.sm-login-spinner-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem; font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.15em;
}
@keyframes sm-auth-spin { to { transform: rotate(360deg); } }
@keyframes sm-auth-shake {
    0%,100% { transform: translateX(0); }
    20%,60%  { transform: translateX(-5px); }
    40%,80%  { transform: translateX(5px); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sm-auth-page { grid-template-columns: 1fr; }
    .sm-auth-left { display: none; }
    .sm-auth-right { padding: 48px 24px; }
    .sm-auth-form-wrap { max-width: 100%; }
}

/* ── Password toggle ── */
.sm-auth-right .sm-pwd-toggle,
.sm-auth-form-wrap .sm-pwd-toggle {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    padding: 4px !important;
    color: #9E8E87 !important;
    transition: opacity .2s !important;
    z-index: 2 !important;
    width: auto !important;
    height: auto !important;
    min-height: unset !important;
    border-radius: 0 !important;
}
.sm-auth-right .sm-pwd-toggle:hover,
.sm-auth-form-wrap .sm-pwd-toggle:hover {
    opacity: .7 !important;
    background: none !important;
    background-color: transparent !important;
    color: #9E8E87 !important;
}
.sm-auth-field input[type=password],
.sm-auth-field input[type=text] {
    padding-right: 40px;
}

/* Link nei messaggi di errore/successo */
.sm-auth-msg-error a,
.sm-auth-msg-success a {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
}
.sm-auth-msg-error a:hover,
.sm-auth-msg-success a:hover {
    opacity: .8;
}

/* Consensi (privacy + termini) nel form di registrazione */
.sm-consent-row { margin-bottom: 8px; }
.sm-consent-label {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer;
    font-size: 0.86rem; font-weight: 400; line-height: 1.45;
    text-transform: none; letter-spacing: 0;
    color: var(--text-mid);
}
.sm-consent-cb {
    width: auto; margin: 2px 0 0; padding: 0;
    flex: 0 0 auto;
    accent-color: var(--gold);
    cursor: pointer;
}
.sm-consent-label a { color: var(--gold); text-decoration: underline; }
.sm-consent-req { color: #c0392b; }
