/* POS.AI auth screens — black & white theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.85);
  --err: #ff6b6b;
}

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

body.auth-page.gate-restoring .auth-form,
body.auth-page.gate-restoring .auth-gate-step {
  visibility: hidden;
}

.auth-gate-msg {
  display: none;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
}

body.auth-page.gate-restoring .auth-gate-msg {
  display: block;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--fg);
  /* Native date/select pickers and scrollbars follow dark UI where supported */
  color-scheme: dark;
  background-color: #0a0a0a;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 255, 255, 0.05), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(255, 255, 255, 0.03), transparent 45%),
    url('../assets/images/wall-bg.png');
  background-size: 100% 100%;
  background-position: top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-shell {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.auth-title {
  margin: 0 0 2.25rem;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#gate-activation-form.auth-form {
  gap: 1.2rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top:10px;
}

.auth-field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(245, 245, 245, 0.92);
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding-left: 0.1rem;
}

.auth-field-label .auth-field-hint {
  font-weight: 400;
  color: var(--muted);
}

.auth-field-req {
  color: #e85d5d;
  font-weight: 600;
}

.field-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 2.85rem;
}

.field-wrap .field-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  flex-shrink: 0;
  padding-left: 0.35rem;
  color: rgba(245, 245, 245, 0.9);
  opacity: 1;
}

.field-icon--align-start {
  align-self: flex-start;
  padding-top: 0.95rem;
}

.field-wrap .field-icon svg {
  width: 18px;
  height: 18px;
}

.field-wrap:not(:has(.field-icon)) input,
.field-wrap:not(:has(.field-icon)) textarea,
.field-wrap:not(:has(.field-icon)) select {
  padding-left: 1rem;
}

.field-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
  padding: 0.95rem 1rem 0.95rem 0.35rem;
  line-height: 1.35;
}

.field-wrap:has(textarea) {
  align-items: flex-start;
  min-height: 0;
}

.field-wrap textarea {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
  padding: 0.95rem 1rem 0.95rem 0.35rem;
  min-height: 5.25rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.field-wrap select {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.35;
  padding: 0.95rem 2.5rem 0.95rem 0.35rem;
  /* Closed state: explicit dark surface so contrast matches inputs */
  background-color: transparent;
  color: var(--fg);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c8c8c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.field-wrap select option,
.field-wrap select optgroup {
  background-color: #1a1a1a;
  color: #f5f5f5;
}

.field-wrap input[type='date'] {
  color: var(--fg);
}

/* WebKit: calendar icon visible on dark field */
.field-wrap input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.75;
  cursor: pointer;
  margin-left: 0.25rem;
}

.field-wrap input[type='date']::-webkit-datetime-edit-text,
.field-wrap input[type='date']::-webkit-datetime-edit-month-field,
.field-wrap input[type='date']::-webkit-datetime-edit-day-field,
.field-wrap input[type='date']::-webkit-datetime-edit-year-field {
  color: var(--fg);
}

.field-wrap input[type='date']:invalid::-webkit-datetime-edit {
  color: var(--muted);
}

.auth-shell--wide {
  max-width: 28rem;
  width: 100%;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  overflow-x: hidden;
  text-align: left;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) rgba(255, 255, 255, 0.06);
}

.auth-shell--wide::-webkit-scrollbar {
  width: 8px;
}

.auth-shell--wide::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.auth-shell--wide::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

.auth-shell--wide::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.auth-page .auth-shell--wide .auth-title {
  text-align: center;
}

.auth-step-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.auth-gate-step.is-hidden {
  display: none !important;
}

.auth-bir-block {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 0.35rem;
  padding-bottom: 0.25rem;
}

.auth-bir-block > .auth-bir-heading {
  margin-top: 0.35rem;
}

.auth-bir-block > .auth-bir-heading:first-child {
  margin-top: 0;
}

.auth-bir-heading {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200, 200, 200, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 0.5rem;
}

.auth-bir-block .auth-check {
  margin-top: 0.1rem;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--fg);
  padding: 0.35rem 0;
}

.auth-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #fff;
}

.auth-btn--ghost {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
}

.auth-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.field-wrap textarea::placeholder,
.field-wrap input::placeholder {
  color: var(--muted);
}

.auth-btn {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  background: #fff;
}

.auth-btn:hover {
  filter: brightness(0.95);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}

.auth-btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-error {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--err);
  text-align: center;
}

.auth-links {
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.auth-links a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-links a:hover {
  opacity: 0.85;
}

.auth-hint code {
  font-size: 0.85em;
  color: rgba(245, 245, 245, 0.95);
}

/* Dashboard (index) */
body.app-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.app-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.app-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.app-actions button,
.app-actions a {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.app-actions button:hover,
.app-actions a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app-main {
  padding: 2rem 1.5rem;
  max-width: 640px;
}

.app-main p {
  color: var(--muted);
  line-height: 1.5;
}
