/* Native-inspired auth sheets. All rules opt in; admin and other modals are untouched. */
body.toma-auth { margin:0; min-height:100dvh; background:var(--background); color:var(--text-primary); font:var(--type-body); color-scheme:light; }
body.toma-auth.dark-mode { color-scheme:dark; }
.toma-auth *, .toma-auth-dialog * { box-sizing:border-box; }
.toma-auth .auth-shell { min-height:100dvh; max-width:1120px; margin:auto; display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); align-items:center; gap:64px; padding:32px; }
.toma-auth .auth-aside { display:flex; flex-direction:column; align-items:start; gap:32px; padding:24px; }
.toma-auth .auth-logo { width:112px; height:auto; }
.toma-auth .aside-kicker { font:var(--type-caption); color:var(--link); }
.toma-auth .aside-title { font:var(--type-heading); font-size:36px; line-height:1.45; margin:12px 0; }
.toma-auth .aside-copy { color:var(--text-secondary); line-height:1.8; }
.toma-auth .auth-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-card); box-shadow:var(--shadow-card); padding:28px; min-width:0; }
.toma-auth .auth-header h1 { font:var(--type-heading); margin:0 0 8px; }
.toma-auth .auth-header p { color:var(--text-secondary); margin:0 0 24px; }
.toma-auth a, .toma-auth-dialog a { color:var(--link); text-decoration:underline; text-underline-offset:4px; }
.toma-auth .auth-tools { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.toma-auth .lang-switch-btn, .toma-auth .auth-theme-toggle, .toma-auth-dialog .auth-chrome-button { background:var(--background); color:var(--text-primary); border:1px solid var(--border); border-radius:var(--radius-input); padding:8px 12px; min-height:44px; font:var(--type-label); cursor:pointer; }
.toma-auth .field { margin:0 0 16px; position:relative; }
.toma-auth .field label, .toma-auth-dialog .auth-field-label { display:block; font:var(--type-label); margin:0 0 8px; color:var(--text-primary); }
.toma-auth .field input, .toma-auth .field select, .toma-auth .field textarea,
.toma-home .toma-auth-dialog input:not([type=checkbox]), .toma-home .toma-auth-dialog select, .toma-home .toma-auth-dialog textarea {
  width:100%; min-height:48px; padding:12px; background:var(--input); color:var(--text-primary); border:1px solid var(--input-border); border-radius:var(--radius-input); font:var(--type-body); margin:0; box-shadow:none;
}
.toma-auth input::placeholder, .toma-auth-dialog input::placeholder { color:var(--placeholder); opacity:1; }
.toma-auth input[type=email], .toma-auth input[type=tel], .toma-auth-dialog input[type=email], .toma-auth-dialog input[type=tel] { direction:ltr; text-align:start; }
.toma-auth .grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.toma-auth .choice-grid, .toma-auth-dialog .auth-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:24px; }
.toma-auth .choice, .toma-auth-dialog .auth-role-button { padding:16px 12px; min-height:76px; background:var(--background); color:var(--text-primary); border:1px solid var(--border); border-radius:var(--radius-button); font:var(--type-label); cursor:pointer; }
.toma-auth .choice.active, .toma-auth-dialog .auth-role-button[aria-pressed=true] { background:var(--brand-tint-1); border-color:var(--link); color:var(--link); }
.toma-auth .provider-fields { display:none; border-top:1px solid var(--border); padding-top:20px; }
.toma-auth .auth-submit, .toma-home .toma-auth-dialog .btn-primary-full { width:100%; min-height:48px; padding:12px 16px; border:0; border-radius:var(--radius-button); font:var(--type-button); background:var(--primary); color:var(--on-primary); cursor:pointer; }
.toma-auth button:disabled, .toma-home .toma-auth-dialog button:disabled { background:var(--disabled-background); color:var(--disabled-text); cursor:not-allowed; }
.toma-auth .terms { display:flex; gap:8px; align-items:start; font:var(--type-caption); color:var(--text-secondary); margin:8px 0 20px; }
.toma-auth input[type=checkbox], .toma-auth-dialog input[type=checkbox] { accent-color:var(--primary); width:20px; height:20px; flex-shrink:0; }
.toma-auth .auth-links { display:flex; justify-content:space-between; flex-wrap:wrap; gap:16px; margin-top:24px; font:var(--type-label); }
.toma-auth .message { display:none; }
.toma-auth .message.show, .toma-auth-dialog .auth-feedback:not(:empty) { display:block; padding:12px 16px; margin:0 0 16px; border-radius:var(--radius-input); overflow-wrap:anywhere; font:var(--type-body); background:var(--info-background); color:var(--info); }
.toma-auth .message.error, .toma-auth-dialog .auth-feedback.error { background:var(--error-background); color:var(--error); }
.toma-auth .message.success, .toma-auth-dialog .auth-feedback.success { background:var(--success-background); color:var(--success); }
.toma-auth .auth-password-wrap { position:relative; }
.toma-auth .auth-password-wrap input { padding-inline-end:82px; }
.toma-auth input[name=code] { letter-spacing:6px; text-align:center; text-transform:uppercase; direction:ltr; }
.toma-auth .auth-password-toggle { position:absolute; inset-inline-end:4px; top:4px; min-width:64px; height:40px; padding:4px; border:0; background:var(--transparent); color:var(--link); font:var(--type-caption); cursor:pointer; }
.toma-auth :focus-visible, .toma-auth-dialog :focus-visible { outline:3px solid var(--link); outline-offset:3px; }
.toma-home .modal.toma-auth-dialog { background:var(--scrim); padding:24px; overflow:auto; align-items:center; justify-content:center; }
.toma-home .modal.toma-auth-dialog.active { display:flex; }
.toma-home .toma-auth-dialog .modal-content { width:min(100%,480px); margin:auto; padding:28px; max-height:calc(100dvh - 48px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--card); color:var(--text-primary); box-shadow:var(--shadow-medium); font:var(--type-body); transition:none; }
.toma-home .toma-auth-dialog .auth-dialog-header { position:sticky; top:-28px; display:flex; align-items:center; gap:16px; background:var(--elevated); border-bottom:1px solid var(--border); z-index:20; padding:16px 28px; margin:-28px -28px 24px; }
.toma-home .toma-auth-dialog .modal-title { position:static; flex:1; min-width:0; font:var(--type-heading); color:var(--text-primary); text-align:start; margin:0; padding:0; background:var(--transparent); }
.toma-home .toma-auth-dialog .modal-close { position:static; flex-shrink:0; width:44px; height:44px; padding:0; color:var(--text-primary); background:var(--background); border:1px solid var(--border); border-radius:var(--radius-full); font:var(--type-heading); }
.toma-home .toma-auth-dialog :is(button,input,select,textarea) { transition:none; }
.toma-home .toma-auth-dialog .auth-form > div, .toma-home .toma-auth-dialog #signupFields > div { margin-bottom:16px; }
.toma-home .toma-auth-dialog .account-type-card { text-align:start !important; display:flex; flex-direction:column; gap:6px; background:var(--background) !important; border-width:1px !important; }
.toma-home .toma-auth-dialog .account-type-card:hover { border-color:var(--link) !important; }
.toma-home .toma-auth-dialog .account-type-card h3, .toma-home .toma-auth-dialog .account-type-card p { font-family:var(--font-system); }
.toma-home .toma-auth-dialog .switch-auth { text-align:center; margin:24px 0 0; color:var(--text-secondary); font:var(--type-label); }
.toma-home .toma-auth-dialog .link-btn { color:var(--link); font:var(--type-label); min-height:44px; }
.toma-home .toma-auth-dialog #passwordRequirements { padding:12px !important; background:var(--subdued) !important; border-color:var(--border) !important; }
.toma-home .toma-auth-dialog #passwordRequirements ul { padding-inline-start:20px; padding-inline-end:0; }
.toma-home .toma-auth-dialog [onclick^="togglePasswordVisibility"] { width:44px; height:44px; inset-inline-end:4px; inset-inline-start:auto; top:auto !important; bottom:2px; transform:none !important; padding:8px !important; }
.toma-home .toma-auth-dialog input[type=password], .toma-home .toma-auth-dialog .auth-visible-password { padding-inline-end:52px !important; padding-inline-start:12px !important; }
.toma-auth .auth-help, .toma-auth-dialog .auth-help { font:var(--type-caption); color:var(--text-secondary); margin:8px 0 20px; }
.toma-auth-dialog .auth-chrome-button { margin-bottom:16px; }
.toma-auth .auth-login-intent .choice-grid, .toma-auth-dialog .auth-login-intent .auth-role-grid { margin-bottom:8px; }
.toma-auth [hidden], .toma-auth-dialog [hidden] { display:none !important; }
.toma-auth form[aria-busy=true] [type=submit], .toma-auth-dialog form[aria-busy=true] [type=submit] { cursor:wait; opacity:.7; }
.toma-auth form[aria-busy=true] [type=submit]::after, .toma-auth-dialog form[aria-busy=true] [type=submit]::after { content:" …"; }
@media(max-width:767px) {
  .toma-auth .auth-shell { display:block; padding:20px 16px 32px; max-width:520px; }
  .toma-auth .auth-aside { padding:4px 0 24px; flex-direction:row; align-items:center; justify-content:space-between; gap:16px; }
  .toma-auth .auth-aside > div { display:none; }
  .toma-auth .auth-logo { width:88px; }
  .toma-auth .auth-card { padding:24px 20px; }
  .toma-auth .grid-2 { grid-template-columns:minmax(0,1fr); }
  .toma-home .modal.toma-auth-dialog { padding:12px; }
  .toma-home .toma-auth-dialog .modal-content { padding:24px 20px; max-height:calc(100dvh - 24px); }
  .toma-home .toma-auth-dialog .auth-dialog-header { top:-24px; margin:-24px -20px 24px; padding:12px 20px; }
}
@media(max-height:600px) { .toma-auth .auth-shell { align-items:start; } .toma-home .modal.toma-auth-dialog { align-items:start; } }
@media(prefers-reduced-motion:reduce) { .toma-auth-dialog, .toma-auth-dialog * { animation:none !important; transition:none !important; } }
