*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

:root {
  --cream:   #F8F5F0;
  --cream2:  #F2EDE5;
  --cream3:  #EAE3D8;
  --brown:   #8B6F5C;
  --brown2:  #6B5244;
  --dark:    #1C1917;
  --dark2:   #2C2420;
  --mid:     #6B6460;
  --muted:   #A89F9A;
  --border:  rgba(139,111,92,0.18);
  --border2: rgba(139,111,92,0.32);
  --gold:    #C9A96E;
  --serif:   'Playfair Display', Georgia, serif;
  --sans:    'Inter', system-ui, sans-serif;
  --ease:    cubic-bezier(0.4,0,0.2,1);
}

body { font-family: var(--sans); background: var(--cream); color: var(--dark); min-height: 100vh; -webkit-font-smoothing: antialiased; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }

.auth-brand { width: 100%; padding: 1.25rem 2rem; border-bottom: 1px solid var(--border); background: rgba(248,245,240,0.95); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.brand-logo { display: inline-flex; align-items: center; text-decoration: none; }
.brand-img { height: 38px; width: auto; object-fit: contain; }

.auth-form-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1.5rem; width: 100%; }

.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--border2); border-radius: 24px; padding: 2.75rem; box-shadow: 0 8px 40px rgba(28,25,23,0.10); }

.auth-header { margin-bottom: 2rem; }
.auth-header h1 { font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--dark); margin-bottom: 0.35rem; line-height: 1.2; }
.auth-header p { font-size: 14px; font-weight: 300; color: var(--muted); }

.field { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.label-opt { font-weight: 300; text-transform: none; letter-spacing: 0; font-size: 11px; }
.field input { width: 100%; padding: 12px 15px; font-family: var(--sans); font-size: 14px; font-weight: 300; background: var(--cream); border: 1.5px solid var(--border2); border-radius: 10px; color: var(--dark); outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.field input:focus { border-color: var(--brown); background: #fff; box-shadow: 0 0 0 3px rgba(139,111,92,0.12); }
.field input.erro { border-color: #C0392B; box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }
.field input::placeholder { color: var(--muted); }

.btn-primary { width: 100%; padding: 13px; margin-top: 0.5rem; font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--cream); background: var(--dark); border: none; border-radius: 10px; cursor: pointer; transition: all 0.2s var(--ease); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover:not(:disabled) { background: var(--dark2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(28,25,23,0.2); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary { display: block; width: 100%; padding: 12px; margin-top: 0.75rem; font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--dark2); background: transparent; border: 1px solid var(--border2); border-radius: 10px; cursor: pointer; text-align: center; text-decoration: none; transition: all 0.2s var(--ease); }
.btn-secondary:hover { background: var(--cream2); border-color: var(--brown); }

.btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(248,245,240,0.3); border-top-color: var(--cream); border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.loading .btn-spinner { display: block; }
.loading .btn-text { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { display: none; padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 400; margin-top: 1rem; line-height: 1.5; align-items: center; gap: 8px; }
.alert.erro    { display: flex; background: #FDF0F0; color: #922B21; border: 1px solid #F5C6C6; }
.alert.sucesso { display: flex; background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }

.auth-terms { font-size: 11px; color: var(--muted); text-align: center; margin-top: 1rem; line-height: 1.6; }
.auth-terms a { color: var(--brown); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 1.5rem 0 0; font-size: 12px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border2); }

.auth-back { margin-top: 1.5rem; font-size: 13px; text-align: center; }
.auth-back a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.auth-back a:hover { color: var(--brown); }

@media (max-width: 520px) {
  .auth-card { padding: 2rem 1.5rem; border-radius: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-header h1 { font-size: 24px; }
}