/* =====================================================================
   N-Client sign-in pages (login.php, login-qr.php)
   Same elements and layout as before (one centred card); restyled.
   Light page in the app colours: red #c9062a and its gradient (tokens in assets/css/style.css).
   ===================================================================== */

body.nc-auth {
  min-height: 100vh;
  color: #2c2a30;
  background-color: #fbf7f8;
  background-image:
    radial-gradient(900px 600px at 12% 8%, rgba(201, 6, 42, .10), transparent 60%),
    radial-gradient(800px 700px at 92% 96%, rgba(234, 53, 80, .09), transparent 60%),
    linear-gradient(160deg, #ffffff 0%, #fbf5f6 55%, #f6ecee 100%);
  background-attachment: fixed;
}
/* animated background (assets/js/nc-auth.js draws a fading grid with light pulses) */
.nc-auth-bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; }
body.nc-auth .app-content { position: relative; z-index: 1; }
html.nc-bg-live body.nc-auth::before { display: none; }   /* the canvas replaces the static CSS grid */

/* static grid: shown until the script runs, or when scripts are off */
body.nc-auth::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(201, 6, 42, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 6, 42, .06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
body.nc-auth .app-content, body.nc-auth .content-wrapper { background: transparent; }
body.nc-auth .flexbox-container { min-height: 100vh; padding: 24px 0; }

/* ---- card ---- */
.nc-auth-card-wrap { width: 100%; max-width: 440px; padding: 0 16px; flex: 0 0 auto; }
body.nc-auth .nc-auth-card {
  position: relative;
  border: 0 !important;
  border-radius: 20px;
  padding: 32px 28px 24px !important;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(201, 6, 42, .06), 0 30px 60px -28px rgba(80, 10, 24, .30);
  animation: nc-auth-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
body.nc-auth .nc-auth-card::before {        /* brand line on top: the app red gradient */
  content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--nc-grad-from), var(--nc-grad-to));
}
@keyframes nc-auth-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

body.nc-auth .card-header, body.nc-auth .card-body { padding: 0 !important; background: transparent; }
.nc-auth-logo { display: block; margin: 0 auto 12px; width: 72px; height: auto; filter: drop-shadow(0 4px 10px rgba(201, 6, 42, .25)); }
.nc-auth-title {
  text-align: center; margin: 0 0 4px;
  font: 600 1.6rem/1.3 "Comfortaa", var(--nc-font-jp, sans-serif);
  color: #2c2a30; letter-spacing: .01em;
}
.nc-auth-title .nc-auth-brand { font-weight: 800; color: #c9062a; }
.nc-auth-title .nc-auth-sep { color: #c5cad6; font-weight: 300; margin: 0 .35em; }

/* ---- error message ---- */
.nc-auth-alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 0 0; padding: 12px 40px 12px 14px; position: relative;
  border-radius: 12px; border: 1px solid #f5c2ca;
  background: #fdecee; color: #8f0220; font-size: .92rem; line-height: 1.55;
}
.nc-auth-alert i { font-size: 1.15rem; margin-top: 2px; color: #c9062a; }
.nc-auth-alert .close { position: absolute; top: 6px; right: 8px; padding: 4px 8px !important; line-height: 1; color: #8f0220; opacity: .7; text-shadow: none; }

/* ---- fields ---- */
body.nc-auth form { margin-top: 22px; }
body.nc-auth .form-group { margin-bottom: 14px; }
body.nc-auth .has-icon-left .form-control.input-xl {
  height: 52px; padding: 0 16px 0 48px !important;
  font-size: 1rem; color: #2c2a30;
  border: 1.5px solid #e6dfe1; border-radius: 12px; background: #f8f9fc;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body.nc-auth .has-icon-left .form-control.input-xl::placeholder { color: #8a93a8; }
body.nc-auth .has-icon-left .form-control.input-xl:hover { border-color: #c6cddc; }
body.nc-auth .has-icon-left .form-control.input-xl:focus {
  border-color: #c9062a; background: #fff; outline: none;
  box-shadow: 0 0 0 4px rgba(201, 6, 42, .12);
}
body.nc-auth .has-icon-left .form-control.input-xl:disabled { background: #f1f3f7; color: #a3abbd; cursor: not-allowed; }
body.nc-auth select.form-control.input-xl {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238a93a8' stroke-width='1.8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px !important;
}
body.nc-auth #user-ID { text-transform: uppercase; letter-spacing: .04em; }
body.nc-auth #user-ID::placeholder { text-transform: none; letter-spacing: 0; }
body.nc-auth .has-icon-left .form-control-position {
  top: 0; left: 0; width: 48px; height: 52px; line-height: 52px;
  display: flex; align-items: center; justify-content: center; color: #8a93a8;
}
body.nc-auth .has-icon-left .form-control-position i { font-size: 1.15rem !important; transition: color .15s; }
body.nc-auth .has-icon-left .form-control:focus ~ .form-control-position i { color: #c9062a; }

/* show / hide password */
.nc-auth-eye {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: #8a93a8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nc-auth-eye:hover { background: #fcf1f3; color: #c9062a; }
body.nc-auth #user-password { padding-right: 52px !important; }

/* the existing empty "line-on-side" paragraph becomes a labelled divider for the name fields */
body.nc-auth .nc-auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 14px !important;
  font-size: .8rem; color: #8a93a8; letter-spacing: .04em;
}
body.nc-auth .nc-auth-divider::before, body.nc-auth .nc-auth-divider::after { content: ""; flex: 1; height: 1px; background: #e6e9f0; }
body.nc-auth .line-on-side { border: 0; }

/* name: typed + picker, side by side (stacked on phones) */
.nc-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.nc-auth .nc-auth-row .form-group { margin-bottom: 0; padding: 0 !important; max-width: none !important; float: none !important; }
@media (max-width: 480px) { .nc-auth-row { grid-template-columns: 1fr; } }

/* ---- buttons ---- */
.nc-auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 0; }
body.nc-auth .nc-auth-actions .btn {
  height: 52px; margin: 0 !important; border-radius: 12px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1rem; letter-spacing: .02em; color: #fff;
  transition: transform .12s, box-shadow .15s, filter .15s;
}
body.nc-auth .nc-auth-actions .btn i { font-size: 1.15rem; }
/* QR login = the light partner of the red Login button */
body.nc-auth .nc-auth-actions .btn.nc-auth-btn-qr { background: #fff !important; color: #c9062a; box-shadow: inset 0 0 0 1.5px #f0b8c2, 0 10px 20px -14px rgba(201, 6, 42, .55); }
body.nc-auth .nc-auth-actions .btn.nc-auth-btn-qr:hover { background: #fcf1f3 !important; filter: none; }
body.nc-auth .nc-auth-btn-login { background: linear-gradient(135deg, var(--nc-grad-from), var(--nc-grad-to)) !important; box-shadow: 0 10px 20px -10px rgba(201, 6, 42, .9); }
body.nc-auth .nc-auth-actions .btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
body.nc-auth .nc-auth-actions .btn:active { transform: translateY(0); filter: brightness(.95); }
body.nc-auth .nc-auth-actions .btn[aria-busy="true"] { filter: saturate(.7); }
@media (max-width: 360px) { .nc-auth-actions { grid-template-columns: 1fr; } }

/* language pill row under the buttons (same place as the old dropdown) */
.nc-auth-lang { display: flex; justify-content: center; margin-top: 20px; }

/* ---- QR page ---- */
.nc-auth-qr {
  margin-top: 22px; border-radius: 16px; overflow: hidden;
  border: 1.5px dashed #c6cddc; background: #f8f9fc; padding: 12px;
}
body.nc-auth #reader { border: 0 !important; }
body.nc-auth #reader__scan_region { background: #fff; border-radius: 12px; }
body.nc-auth #reader__dashboard_section_csr button,
body.nc-auth #reader__dashboard button {
  border: 0; border-radius: 10px; padding: 10px 18px; margin: 6px 4px;
  background: #c9062a; color: #fff; font-weight: 700; cursor: pointer;
}
body.nc-auth #reader__dashboard select { border: 1.5px solid #dde2ec; border-radius: 10px; padding: 8px 10px; max-width: 100%; }
body.nc-auth #reader__dashboard_section_swaplink { color: #c9062a !important; font-weight: 600; }
.nc-auth-qr-hint { text-align: center; color: #5b6478; font-size: .9rem; margin: 14px 0 0; }
.nc-auth-qr-msg { text-align: center; margin: 12px 0 0; font-size: .9rem; color: #8f0220; min-height: 1.2em; }
.nc-auth-link {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px;
  font-weight: 700; color: #c9062a !important;
}
.nc-auth-link:hover { color: #9e031f !important; text-decoration: none; }

@media (max-width: 480px) {
  body.nc-auth .nc-auth-card { padding: 26px 18px 20px !important; border-radius: 18px; }
  .nc-auth-title { font-size: 1.4rem; }
}

/* ---- email / mobile for the one-time code (shown only when login OTP is configured) ---- */
body.nc-auth .nc-auth-contact { margin: 14px 0 6px; }
.nc-auth-note { margin: 0 2px; font-size: .8rem; color: #8a93a8; line-height: 1.5; }

/* ---- one-time code page (login-otp.php) ---- */
.nc-otp-lead { text-align: center; color: #5b6478; margin: 14px 0 0; line-height: 1.65; font-size: .95rem; }
.nc-otp-lead strong { color: #c9062a; word-break: break-all; }
body.nc-auth .nc-otp-input {
  width: 100%; height: 64px; margin-top: 0; padding: 0 0 0 .5em;
  text-align: center; font: 700 1.9rem/1 "Muli", ui-monospace, monospace; letter-spacing: .5em; color: #2c2a30;
  border: 1.5px solid #e6dfe1; border-radius: 14px; background: #f8f9fc;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body.nc-auth .nc-otp-input::placeholder { color: #c6cddc; letter-spacing: .5em; }
body.nc-auth .nc-otp-input:focus { border-color: #c9062a; background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(201, 6, 42, .12); }
.nc-otp-remember { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: .88rem; color: #5b6478; cursor: pointer; }
.nc-otp-remember input { width: 18px; height: 18px; accent-color: #c9062a; }
.nc-auth-actions.nc-single { grid-template-columns: 1fr; }
.nc-otp-links { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.nc-otp-linkbtn { background: none; border: 0; padding: 6px 0; font-weight: 700; font-size: .9rem; color: #c9062a; cursor: pointer; }
.nc-otp-linkbtn:hover:not(:disabled) { color: #9e031f; }
.nc-otp-linkbtn:disabled { color: #a3abbd; cursor: not-allowed; }
.nc-auth-info {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; padding: 12px 14px;
  border-radius: 12px; border: 1px solid #eadfe1; background: #faf6f7; color: #4d4a52; font-size: .92rem; line-height: 1.55;
}
.nc-auth-info i { font-size: 1.15rem; margin-top: 2px; color: #c9062a; }

/* email / mobile switch above the verification field */
.nc-auth-contact-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 16px 0 10px; border-radius: 12px; background: #f1f3f8; }
.nc-auth-contact-kind button {
  height: 36px; border: 0; border-radius: 9px; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: .88rem; color: #5b6478; transition: background-color .15s, color .15s, box-shadow .15s;
}
.nc-auth-contact-kind button:hover { color: #c9062a; }
.nc-auth-contact-kind button[aria-checked="true"] { background: #fff; color: #c9062a; box-shadow: 0 1px 4px rgba(201, 6, 42, .18); }
.nc-auth-soon { font-size: .68rem; font-weight: 700; color: #c9062a; background: #fdecee; border-radius: 6px; padding: 1px 6px; }
body.nc-auth .nc-auth-contact-kind + .nc-auth-contact { margin-top: 0; }
.nc-auth-note-warn { color: #8f0220; margin-top: 4px; }
