/* css/auth.css — Mobile-first */

:root {
    --brand-primary:       #0E7C66;
    --brand-primary-hover: #0B6B58;
    --bg-app:      #FFFFFF;
    --bg-section:  #F7F9F8;
    --bg-card:     #FFFFFF;
    --border-card: #E5E7EB;
    --text-primary:   #111827;
    --text-secondary: #4B5563;
    --text-muted:     #9CA3AF;
    --error: #DC2626;
    --radius-card:   18px;
    --radius-input:  12px;
    --radius-button: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-section);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(14,124,102,0.05) 0%, transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(14,124,102,0.05) 0%, transparent 30%);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* safe-area for iPhones with notch */
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
}

/* ---- Card ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    /* Padding: ampio su desktop, compatto su mobile */
    padding: clamp(28px, 8vw, 44px) clamp(20px, 7vw, 40px);
    border-radius: var(--radius-card);
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow:
        0 8px 24px -4px rgba(0,0,0,0.04),
        0 0 0 1px var(--border-card);
    animation: fadeInUp 0.45s cubic-bezier(0.16,1,0.3,1) forwards;
    position: relative;
    overflow: hidden;
}

/* Accent bar top */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0E7C66, #22c55e);
}

/* ---- Brand ---- */
.brand-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-logo {
    height: 28px;
    margin: 0 auto 20px;
    display: block;
    object-fit: contain;
}

.brand-header h2 {
    font-size: clamp(1.25rem, 5vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.brand-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- Form ---- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    /* 48px min touch target */
    padding: 13px 15px;
    background: #F9FAFB;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-input);
    color: var(--text-primary);
    font-size: 1rem; /* 16px evita zoom su iOS */
    font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:hover  { background: #F3F4F6; border-color: #D1D5DB; }
.form-group input:focus  {
    outline: none;
    background: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14,124,102,0.12);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.password-toggle:hover {
    background: #EEF2F1;
    color: var(--text-primary);
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

/* ---- Submit button ---- */
.btn {
    width: 100%;
    /* min 48px touch target */
    padding: 14px 20px;
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-button);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover  { background: var(--brand-primary-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(14,124,102,0.2); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* ---- Links ---- */
.link-group {
    text-align: center;
    margin-top: 28px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.link-group a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s;
}

.link-group a:hover { color: var(--brand-primary); text-decoration: underline; }

/* ---- Error ---- */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.error-container {
    margin-bottom: 20px;
    animation: slideDown 0.28s ease;
}

.error-message {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--error);
    padding: 11px 14px;
    border-radius: var(--radius-input);
    font-size: 0.84rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 9px;
}
