/* ==========================================================================
   RealMe® (Tēnei Au) & New Zealand Immigration — Official Design System
   Exact pixel-perfect replica of login.realme.govt.nz & immigration portal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --realme-orange: #DF3B00;
  --realme-orange-dark: #C43200;
  --realme-orange-hover: #E8450A;
  --realme-orange-light: #FFF5F0;
  --realme-header-bg: #000000;
  --realme-footer-bg: #DF3B00;
  --realme-text-dark: #1E293B;
  --realme-text-body: #334155;
  --realme-text-muted: #64748B;
  --realme-input-bg: #EEF4FB;
  --realme-input-border: #BCD0E5;
  --realme-input-focus: #1E3A8A;
  --realme-radius-sm: 6px;
  --realme-radius-md: 8px;
  --realme-radius-pill: 28px;
  --realme-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --realme-mono: 'JetBrains Mono', monospace;
  --realme-max-width: 1140px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body.realme-body {
  font-family: var(--realme-font);
  background-color: #FFFFFF;
  color: var(--realme-text-body);
  line-height: 1.5;
  font-size: 14.5px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. Official Black Top Header
   ========================================================================== */
.realme-header-wrapper {
  background-color: var(--realme-header-bg);
  width: 100%;
  border-bottom: 1px solid #111111;
}

.realme-header {
  max-width: var(--realme-max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.realme-header-left {
  display: flex;
  align-items: center;
}

.realme-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.realme-logo-svg {
  height: 48px;
  width: auto;
  display: block;
}

.realme-header-right {
  display: flex;
  align-items: center;
}

.nz-immigration-logo-svg {
  height: 44px;
  width: auto;
  display: block;
}

/* ==========================================================================
   2. Sub-Header (Go Back + Outage Notice)
   ========================================================================== */
.realme-subbar-container {
  max-width: var(--realme-max-width);
  margin: 0 auto;
  padding: 24px 24px 0 24px;
  width: 100%;
}

.realme-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #222222;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.realme-back-btn:hover {
  color: var(--realme-orange);
  text-decoration: underline;
}

.realme-back-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #333333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: #222222;
}

.realme-back-btn:hover .realme-back-circle {
  border-color: var(--realme-orange);
  color: var(--realme-orange);
}

.realme-outage-notice {
  margin-top: 22px;
  font-size: 13.5px;
  color: #555555;
  line-height: 1.55;
  max-width: 900px;
}

/* ==========================================================================
   3. Main Body Container & Dual-Column Grid
   ========================================================================== */
.realme-main {
  flex: 1 0 auto;
  max-width: var(--realme-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
}

.realme-login-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
  position: relative;
}

.realme-col {
  display: flex;
  flex-direction: column;
}

.realme-col-divider {
  position: relative;
  padding-right: 28px;
}

.realme-col-divider::after {
  content: '';
  position: absolute;
  right: -28px;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #E2E8F0;
}

/* Headings */
.realme-heading {
  font-size: 2.15rem;
  font-weight: 300;
  color: #111111;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.2px;
}

.realme-heading strong,
.realme-heading .brand-highlight {
  color: var(--realme-orange);
  font-weight: 700;
}

.realme-lead {
  font-size: 14.5px;
  color: #333333;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.realme-sublead {
  font-size: 14.5px;
  color: #444444;
  line-height: 1.55;
  margin-bottom: 2rem;
}

/* ==========================================================================
   4. Form Controls & Inputs (Authentic Light Blue Background)
   ========================================================================== */
.realme-form-group {
  margin-bottom: 1.35rem;
}

.realme-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 0.4rem;
}

.realme-label .req {
  color: #DC2626;
  font-weight: 700;
}

.realme-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: #111111;
  background-color: var(--realme-input-bg);
  border: 1px solid var(--realme-input-border);
  border-radius: var(--realme-radius-md);
  outline: none;
  transition: all 0.15s ease-in-out;
}

.realme-input:focus {
  border-color: #0F172A;
  background-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.realme-input.is-invalid {
  border-color: #DC2626;
  background-color: #FFF5F5;
}

.realme-input-hint {
  font-size: 12.5px;
  color: var(--realme-text-muted);
  margin-top: 0.35rem;
}

.realme-input-error {
  font-size: 13px;
  color: #DC2626;
  font-weight: 600;
  margin-top: 0.35rem;
}

/* ==========================================================================
   5. Buttons (Official RealMe Pill Buttons)
   ========================================================================== */
.realme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: #FFFFFF;
  background-color: var(--realme-orange);
  border: none;
  border-radius: var(--realme-radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.realme-btn:hover {
  background-color: var(--realme-orange-dark);
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(223, 59, 0, 0.25);
}

.realme-btn.disabled,
.realme-btn:disabled,
.realme-btn[disabled],
.realme-btn[aria-disabled="true"] {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.realme-btn:active {
  transform: translateY(1px);
}

.realme-btn-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  flex-shrink: 0;
}

.realme-btn-full {
  width: 100%;
}

/* Links */
.realme-forgot-link-box {
  margin-top: 1.25rem;
}

.realme-forgot-link {
  color: var(--realme-orange);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: text-decoration 0.15s ease;
}

.realme-forgot-link:hover {
  text-decoration: underline;
  color: var(--realme-orange-dark);
}

.realme-link {
  color: var(--realme-orange);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.realme-link:hover {
  text-decoration: underline;
  color: var(--realme-orange-dark);
}

/* ==========================================================================
   6. Alerts & Notifications
   ========================================================================== */
.realme-alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--realme-radius-md);
  margin-bottom: 1.5rem;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.realme-alert-error {
  background-color: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.realme-alert-success {
  background-color: #F0FDF4;
  color: #166534;
  border: 1px solid #86EFAC;
}

/* ==========================================================================
   7. Official Burnt Orange Footer
   ========================================================================== */
.realme-footer-wrapper {
  background-color: var(--realme-footer-bg);
  color: #FFFFFF;
  margin-top: auto;
  width: 100%;
}

.realme-footer {
  max-width: var(--realme-max-width);
  margin: 0 auto;
  padding: 30px 24px 26px 24px;
}

.realme-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.realme-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
}

.realme-footer-link {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.realme-footer-link:hover {
  text-decoration: underline;
  opacity: 0.95;
}

.realme-footer-lang {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

.realme-lang-btn {
  color: #FFFFFF;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.realme-lang-btn.active {
  background-color: rgba(255, 255, 255, 0.25);
}

.realme-lang-btn:hover {
  text-decoration: underline;
}

.realme-footer-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.38);
  margin: 18px 0 16px 0;
}

.realme-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.realme-footer-copyright {
  font-size: 13.5px;
  font-weight: 400;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   8. Fast Demo Sandbox Switcher (Discreet)
   ========================================================================== */
.realme-demo-box {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--realme-radius-md);
  padding: 1rem;
  margin-top: 2rem;
}

.realme-demo-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.realme-demo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.realme-demo-pill {
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.realme-demo-pill:hover {
  border-color: var(--realme-orange);
  color: var(--realme-orange);
  background-color: #FFF9F6;
}

/* ==========================================================================
   9. Registration Page Styles
   ========================================================================== */
.realme-register-container {
  max-width: 680px;
  margin: 0 auto;
}

.realme-instruction-box {
  background-color: #FFFFFF;
  margin-bottom: 2rem;
}

.realme-instruction-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222222;
  margin-bottom: 0.65rem;
}

.realme-instruction-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.realme-instruction-list li {
  font-size: 14px;
  color: #444444;
  position: relative;
  padding-left: 1.2rem;
}

.realme-instruction-list li::before {
  content: '•';
  color: var(--realme-orange);
  position: absolute;
  left: 0;
  font-size: 18px;
  line-height: 1;
}

.realme-inline-action {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.realme-inline-action .realme-input {
  flex: 1;
}

.realme-verify-code-panel {
  background-color: #F9FAFB;
  border: 1.5px dashed #CBD5E1;
  border-radius: var(--realme-radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: none;
}

.realme-verify-code-panel.active {
  display: block;
  animation: realmeFadeIn 0.25s ease-in-out;
}

@keyframes realmeFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   10. Modals for Footer Links (Help, Terms, Privacy, About)
   ========================================================================== */
.realme-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.realme-modal-backdrop.active {
  display: flex;
}

.realme-modal {
  background: #FFFFFF;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  animation: realmePop 0.2s ease-out;
}

@keyframes realmePop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.realme-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.realme-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.realme-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748B;
  cursor: pointer;
  line-height: 1;
}

.realme-modal-close:hover {
  color: #0F172A;
}

.realme-modal-body {
  padding: 24px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #334155;
}

/* ==========================================================================
   11. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
  .realme-login-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .realme-col-divider {
    padding-right: 0;
  }
  .realme-col-divider::after {
    display: none;
  }
  .realme-header {
    padding: 12px 16px;
  }
  .realme-logo-svg {
    height: 38px;
  }
  .nz-immigration-logo-svg {
    height: 34px;
  }
  .realme-subbar-container {
    padding: 18px 16px 0 16px;
  }
  .realme-main {
    padding: 24px 16px 48px 16px;
  }
  .realme-footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .realme-footer-nav {
    gap: 16px;
  }
}
