@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --ic-orange: #ff6a00;
  --ic-orange-hot: #ff7a1a;
  --ic-orange-deep: #e85a00;
  --ic-ink: #161616;
  --ic-muted: #8b8f96;
  --ic-line: #e8e8ea;
  --ic-bg: #ffffff;
  --ic-soft: #f7f7f8;
  --ic-radius: 32px;
  --ic-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ic-safe-top: env(safe-area-inset-top, 0px);
  --ic-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body.ic-auth:not(.ic-auth--fiesta) {
  background: var(--ic-bg);
}

body.ic-auth {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ic-ink);
  -webkit-font-smoothing: antialiased;
}

body.ic-auth.ic-auth--fiesta {
  font-family: 'Fredoka', Inter, system-ui, sans-serif;
  color: #fffef8;
  background: transparent;
}

.ic-phone {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.ic-auth:not(.ic-auth--fiesta) .ic-phone {
  background: var(--ic-bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.ic-auth--fiesta .ic-phone {
  background: transparent;
  box-shadow: none;
}

/* ---- Login hero (photo only, no white wash) ---- */
.ic-hero {
  position: relative;
  height: clamp(220px, 36vh, 300px);
  flex-shrink: 0;
  overflow: hidden;
  background: #1a1a1a;
}

.ic-hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.ic-hero .ic-logo {
  position: absolute;
  left: 50%;
  top: calc(12px + var(--ic-safe-top));
  transform: translateX(-50%);
  z-index: 2;
}

/* ---- Logo (IRONCORE.png) ---- */
.ic-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 0;
}

.ic-logo__img {
  display: block;
  width: min(200px, 72vw);
  height: auto;
  max-height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.12));
}

.ic-hero .ic-logo__img {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.2));
}

.ic-logo--compact .ic-logo__img {
  width: min(168px, 58vw);
  max-height: 72px;
}

.ic-logo--faint .ic-logo__img {
  opacity: 0.45;
  filter: grayscale(0.15);
}

/* ---- Login sheet ---- */
.ic-auth--login .ic-sheet {
  position: relative;
  z-index: 3;
  margin-top: 0;
  background: var(--ic-bg);
  border-radius: var(--ic-radius) var(--ic-radius) 0 0;
  padding: 20px 24px calc(24px + var(--ic-safe-bottom));
  flex: 1;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.ic-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ic-ink);
  line-height: 1.15;
}

.ic-title__accent { color: var(--ic-orange); }

.ic-sub {
  margin: 10px 0 24px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ic-muted);
  max-width: 300px;
}

.ic-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4ec;
  border: 1px solid #ffd7b8;
  color: #9a3d00;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.ic-alert--ok {
  background: #edf9f0;
  border-color: #c6ecd2;
  color: #1e6b38;
}

.ic-form { display: flex; flex-direction: column; gap: 2px; }

.ic-form__spacer { height: 16px; }

.ic-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 0 10px;
  border-bottom: 1.5px solid var(--ic-line);
}

.ic-field:focus-within { border-bottom-color: var(--ic-orange); }

.ic-field svg:not(.ic-eye) {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #b0b4ba;
}

.ic-field:focus-within svg:not(.ic-eye) { color: var(--ic-orange); }

.ic-field__ico {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  line-height: 0;
}

.ic-field__ico img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.ic-forgot {
  margin: 4px 0 14px;
  text-align: right;
}

.ic-forgot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ic-muted);
  text-decoration: none;
}

.ic-forgot a:hover {
  color: var(--ic-orange);
}

.ic-forgot__ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.ic-dial {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ic-ink);
  padding-right: 2px;
}

.ic-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ic-ink);
  padding: 6px 0;
}

.ic-field input::placeholder { color: #b8bcc2; font-weight: 500; }

.ic-field--password { padding-right: 2px; }

.ic-field__toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b0b4ba;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.ic-field__toggle:hover { color: var(--ic-orange); }

.ic-field__toggle .ic-eye {
  width: 20px;
  height: 20px;
}

.ic-field__toggle .ic-eye--on { display: none; }

.ic-field__toggle[data-visible="1"] .ic-eye--off { display: none; }
.ic-field__toggle[data-visible="1"] .ic-eye--on { display: block; }

.ic-field--captcha { gap: 8px; }

.ic-captcha {
  height: 36px;
  width: 108px;
  border-radius: 8px;
  background: var(--ic-soft);
  object-fit: contain;
  cursor: pointer;
  flex-shrink: 0;
}

.ic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 22px;
  flex-wrap: wrap;
}

.ic-row--solo {
  justify-content: flex-start;
}

.ic-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ic-ink);
  cursor: pointer;
  user-select: none;
}

.ic-check input { position: absolute; opacity: 0; pointer-events: none; }

.ic-check__box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid #d5d8de;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ic-check input:checked + .ic-check__box {
  background: var(--ic-orange);
  border-color: var(--ic-orange);
}

.ic-check__box svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.ic-check input:checked + .ic-check__box svg { opacity: 1; }

.ic-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ic-orange);
  text-decoration: none;
  white-space: nowrap;
}

.ic-link:hover { text-decoration: underline; }

.ic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ic-ease), box-shadow 0.12s var(--ic-ease);
}

.ic-btn svg { width: 18px; height: 18px; }

.ic-btn--fill {
  color: #fff;
  background: linear-gradient(180deg, var(--ic-orange-hot) 0%, var(--ic-orange) 55%, var(--ic-orange-deep) 100%);
  box-shadow: 0 12px 24px rgba(255, 106, 0, 0.32);
}

.ic-btn--ghost {
  color: var(--ic-orange);
  background: #fff;
  border: 1.8px solid var(--ic-orange);
  box-shadow: none;
}

.ic-btn:active { transform: scale(0.985); }

.ic-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.ic-or {
  margin: 20px 0 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ic-muted);
}

.ic-switch {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ic-muted);
  position: relative;
  z-index: 3;
}

.ic-switch a {
  color: var(--ic-orange);
  font-weight: 700;
  text-decoration: none;
}

.ic-switch a:hover { text-decoration: underline; }

/* ---- Register header ---- */
.ic-reg-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding:
    calc(8px + var(--ic-safe-top))
    max(14px, env(safe-area-inset-right, 0px))
    4px
    max(14px, env(safe-area-inset-left, 0px));
  flex-shrink: 0;
  min-height: 56px;
}

.ic-reg-top__brand {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.ic-reg-top__brand .ic-logo {
  margin: 0 auto;
}

.ic-back {
  position: absolute;
  left: max(14px, env(safe-area-inset-left, 0px));
  top: calc(8px + var(--ic-safe-top));
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ic-ink);
  text-decoration: none;
  border-radius: 12px;
  margin-top: 0;
}

.ic-back:active { opacity: 0.65; }

.ic-back svg { width: 22px; height: 22px; }

.ic-reg-top .ic-logo { justify-self: center; }

.ic-reg-body {
  padding: 6px 24px 20px;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* ---- Register bottom art (below form, no overlap) ---- */
.ic-reg-bottom {
  position: relative;
  flex-shrink: 0;
  min-height: 168px;
  width: 100%;
  pointer-events: none;
}

.ic-reg-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(68%, 268px);
  height: 178px;
  pointer-events: none;
  z-index: 1;
}

.ic-reg-art__shape {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ff8a1a 0%, #ff6a00 48%, #e85a00 100%);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.ic-reg-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  clip-path: polygon(38% 6%, 100% 0, 100% 100%, 8% 100%);
}

.ic-reg-quote {
  position: absolute;
  left: 24px;
  bottom: calc(28px + var(--ic-safe-bottom));
  z-index: 2;
  max-width: 42%;
  pointer-events: none;
}

.ic-reg-quote p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  color: #222;
}

.ic-reg-quote p::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--ic-orange);
}

@media (max-width: 360px) {
  .ic-title { font-size: 26px; }
  .ic-auth--login .ic-sheet, .ic-reg-body { padding-left: 18px; padding-right: 18px; }
  .ic-reg-quote { left: 18px; max-width: 48%; }
  .ic-reg-quote p { font-size: 12px; }
}

@media (min-width: 431px) {
  body.ic-auth {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
  }
}

/* ---- Fiesta auth (no photo buildings) ---- */
body.ic-auth--fiesta .ic-phone {
  background: transparent;
  box-shadow: none;
}

body.ic-auth--fiesta .ic-login__inner {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(40px + var(--ic-safe-top))
    max(22px, env(safe-area-inset-right, 0px))
    calc(28px + var(--ic-safe-bottom))
    max(22px, env(safe-area-inset-left, 0px));
}

body.ic-auth--fiesta .ic-reg-body.ic-fiesta-panel {
  margin-top: auto;
  padding: 22px 20px 24px;
  border: 3px solid #2a0a45;
  border-radius: 28px;
  box-shadow: 0 6px 0 #2a0a45, 0 16px 32px rgba(0, 0, 0, 0.35);
}

body.ic-auth--fiesta .ic-title {
  font-family: 'Fredoka', Inter, system-ui, sans-serif;
  color: #fffef8;
  text-shadow: 1px 1px 0 #2a0a45;
}

body.ic-auth--fiesta .ic-title__accent {
  color: #ffe45a;
}

body.ic-auth--fiesta .ic-sub {
  color: rgba(255, 254, 248, 0.88);
  text-shadow: none;
}

body.ic-auth--fiesta .ic-field {
  border-bottom: 2px solid rgba(255, 254, 248, 0.35);
}

body.ic-auth--fiesta .ic-field:focus-within {
  border-bottom-color: #ff9f1c;
}

body.ic-auth--fiesta .ic-dial,
body.ic-auth--fiesta .ic-field input {
  color: #2a0a45;
}

body.ic-auth--fiesta .ic-btn--fill {
  background: linear-gradient(180deg, #8ee026, #5fa318);
  color: #2a0a45;
  border: 3px solid #2a0a45;
  box-shadow: 0 4px 0 #2a0a45;
  font-weight: 700;
}

body.ic-auth--fiesta .ic-btn--ghost {
  background: #fff;
  border: 3px solid #2a0a45;
  color: #2a0a45;
  box-shadow: 0 3px 0 #2a0a45;
}

body.ic-auth--fiesta .ic-back {
  top: calc(10px + var(--ic-safe-top));
  background: #ffe566;
  color: #2a0a45;
  border: 2px solid #2a0a45;
  box-shadow: 0 3px 0 #2a0a45;
}

body.ic-auth--fiesta .ic-switch {
  color: rgba(255, 254, 248, 0.92);
}

body.ic-auth--fiesta .ic-switch a {
  color: #ffe45a;
  font-weight: 800;
  text-shadow: 1px 1px 0 #2a0a45;
}

body.ic-auth--fiesta .ic-check {
  color: rgba(255, 254, 248, 0.95);
  text-shadow: 1px 1px 0 rgba(42, 10, 69, 0.45);
}

body.ic-auth--fiesta .ic-or {
  color: rgba(255, 254, 248, 0.88);
}

body.ic-auth--fiesta .ic-reg-quote p {
  color: #fffef8;
  text-shadow: 1px 1px 0 #2a0a45;
}

body.ic-auth--fiesta.ic-auth--register .ic-reg-body {
  flex: 1;
  padding: 6px 24px 12px;
  padding-bottom: 12px;
}

body.ic-auth--fiesta .ic-reg-bottom {
  min-height: 152px;
  margin-top: 0;
}

/* ---- Login + Register: transparent form (sunburst visible) ---- */
body.ic-auth--login.ic-auth--fiesta .ic-login__panel,
body.ic-auth--register.ic-auth--fiesta .ic-reg-body {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.ic-auth--login.ic-auth--fiesta .ic-login__panel::before,
body.ic-auth--login.ic-auth--fiesta .ic-login__panel::after,
body.ic-auth--register.ic-auth--fiesta .ic-reg-body::before,
body.ic-auth--register.ic-auth--fiesta .ic-reg-body::after {
  display: none !important;
  content: none !important;
}

body.ic-auth--login.ic-auth--fiesta .ic-dial,
body.ic-auth--register.ic-auth--fiesta .ic-dial,
body.ic-auth--login.ic-auth--fiesta .ic-field input,
body.ic-auth--register.ic-auth--fiesta .ic-field input {
  color: #fffef8;
}

body.ic-auth--login.ic-auth--fiesta .ic-field input::placeholder,
body.ic-auth--register.ic-auth--fiesta .ic-field input::placeholder {
  color: rgba(255, 254, 248, 0.58);
}

body.ic-auth--login.ic-auth--fiesta .ic-field__toggle,
body.ic-auth--register.ic-auth--fiesta .ic-field__toggle {
  color: rgba(255, 254, 248, 0.78);
}

body.ic-auth--login.ic-auth--fiesta .ic-field__toggle:hover,
body.ic-auth--login.ic-auth--fiesta .ic-field:focus-within .ic-field__toggle,
body.ic-auth--register.ic-auth--fiesta .ic-field__toggle:hover,
body.ic-auth--register.ic-auth--fiesta .ic-field:focus-within .ic-field__toggle {
  color: #ff9f1c;
}

body.ic-auth--login.ic-auth--fiesta .ic-field__ico img,
body.ic-auth--register.ic-auth--fiesta .ic-field__ico img {
  filter: brightness(0) invert(1) drop-shadow(0 1px 0 rgba(42, 10, 69, 0.35));
  transition: filter 0.15s var(--ic-ease);
}

body.ic-auth--login.ic-auth--fiesta .ic-field:focus-within .ic-field__ico img,
body.ic-auth--register.ic-auth--fiesta .ic-field:focus-within .ic-field__ico img {
  filter: brightness(0) saturate(100%) invert(55%) sepia(95%) saturate(2800%) hue-rotate(360deg) brightness(103%) contrast(101%);
}

body.ic-auth--register.ic-auth--fiesta .ic-switch,
body.ic-auth--register.ic-auth--fiesta .ic-sub {
  color: rgba(255, 254, 248, 0.82);
}

body.ic-auth--register.ic-auth--fiesta .ic-captcha {
  border: 2px solid rgba(255, 254, 248, 0.35);
  background: rgba(255, 254, 248, 0.12);
}

body.ic-auth--fiesta .ic-reg-top {
  padding-top: calc(10px + var(--ic-safe-top));
}

body.ic-auth--fiesta .ic-logo__img {
  filter: drop-shadow(0 3px 0 #2a0a45);
}

/* ---- Login-only layout ---- */
body.ic-auth--login.ic-auth--fiesta .ic-login__panel {
  margin-top: auto;
  width: 100%;
  padding: 10px 8px 0;
}

body.ic-auth--login.ic-auth--fiesta .ic-check__box {
  border-color: rgba(255, 254, 248, 0.55);
  background: rgba(255, 254, 248, 0.12);
}

body.ic-auth--login.ic-auth--fiesta .ic-check input:checked + .ic-check__box {
  background: #ff9f1c;
  border-color: #ff9f1c;
}

body.ic-auth--login.ic-auth--fiesta .ic-login__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.ic-auth--login.ic-auth--fiesta .ic-login__brand {
  flex-shrink: 0;
  padding-top: calc(8px + var(--ic-safe-top));
}

body.ic-auth--login.ic-auth--fiesta .ic-login__panel {
  padding-bottom: 12px;
}

body.ic-auth--login.ic-auth--fiesta .ic-reg-bottom--login {
  flex-shrink: 0;
  min-height: 152px;
  margin-top: 0;
}

body.ic-auth--login.ic-auth--fiesta .ic-title,
body.ic-auth--login.ic-auth--fiesta .ic-sub,
body.ic-auth--login.ic-auth--fiesta .ic-check,
body.ic-auth--login.ic-auth--fiesta .ic-or {
  color: rgba(255, 254, 248, 0.92);
}

body.ic-auth--login.ic-auth--fiesta .ic-sub,
body.ic-auth--login.ic-auth--fiesta .ic-or {
  color: rgba(255, 254, 248, 0.82);
}
