/* -------------------------------------------------- */
/* BASE                                               */
/* -------------------------------------------------- */

:root {
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --login-accent: #22c55e;
    --hairline: rgba(255,255,255,0.08);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #0f1115;
    color: #e5e7eb;
}

/* -------------------------------------------------- */
/* BUTTON */
/* -------------------------------------------------- */

button {
    padding: 5px 9px;
    font-size: 0.7rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

/* -------------------------------------------------- */
/* FLASH */
/* -------------------------------------------------- */

.flash-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(90vw, 360px);
}

.flash {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-left: 4px solid;
  font-size: 0.925rem;
  line-height: 1.4;
  color: #1f2937;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  animation: flash-in 0.3s ease-out;
}

/* Leading icon via pseudo-element */
.flash::before {
  font-size: 1.1rem;
  line-height: 1;
}

/* --- Category variants --- */
.flash.success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}
.flash.success::before { content: "✓"; }

.flash.error,
.flash.danger {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}
.flash.error::before,
.flash.danger::before { content: "✕"; }

.flash.warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.flash.warning::before { content: "⚠"; }

.flash.info,
.flash.message {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.flash.info::before,
.flash.message::before { content: "ℹ"; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------- */
/* LOGIN PAGE */
/* -------------------------------------------------- */

.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 380px;
}

/* --- wordmark --- */

.login-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9ca3af;
}

.login-mark-bar {
    width: 3px;
    height: 14px;
    border-radius: 1px;
    background: var(--login-accent);
}

/* --- card --- */

.login-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px;
    background: #171a21;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

.login-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f3f4f6;
}

/* --- alert --- */

.login-alert {
    padding: 10px 12px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.22);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #fca5a5;
}

.login-alert p {
    margin: 0;
}

.login-alert p + p {
    margin-top: 4px;
}

/* --- fields --- */

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: #7c8594;
}

.field-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #f3f4f6;
    background: #12151c;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    outline: none;
    color-scheme: dark;
    transition: border-color 130ms ease, box-shadow 130ms ease;
}

.field-input:hover {
    border-color: rgba(255,255,255,0.14);
}

.field-input:focus {
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* --- submit --- */

/* Overrides the compact `button` reset above. */
.login-submit {
    margin-top: 2px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #052e16;
    background: var(--login-accent);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 130ms ease;
}

.login-submit:hover {
    background: #16a34a;
}

.login-submit:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 3px;
}

/* --- carrier --- */

.carrier {
    margin-top: 26px;
}

.carrier-line {
    position: relative;
    height: 1px;
    background: var(--hairline);
    overflow: hidden;
}

.carrier-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 34%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(34,197,94,0.55) 55%,
        rgba(34,197,94,0.9));
    animation: carrier-sweep 4.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.carrier-readout {
    margin: 11px 0 0;
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: #4b5563;
}

@keyframes carrier-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(394%); }   /* 100/0.34 -- clears the full width */
}

@media (prefers-reduced-motion: reduce) {
    .carrier-pulse {
        animation: none;
        width: 100%;
        opacity: 0.28;
    }

    .field-input,
    .login-submit {
        transition: none;
    }
}

/* --- narrow screens --- */

@media (max-width: 420px) {
    .login-page {
        padding: 16px;
        place-items: start center;
        padding-top: 12vh;
    }

    .login-card {
        padding: 22px;
    }
}
