/* ==========================================================================
   Afterpay Official Stylesheet - Standard Format
   Directly matching official portal snippet & typography
   ========================================================================== */

/* Official Afterpay Brand Fonts */
@font-face {
  font-family: 'Italianplate';
  src: url('./fonts/ItalianPlateNo2Expanded-Regular.woff2') format('woff2'),
       url('./fonts/ItalianPlateNo2Expanded-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Italianplate';
  src: url('./fonts/ItalianPlateNo2Expanded-Bold.woff2') format('woff2'),
       url('./fonts/ItalianPlateNo2Expanded-Bold.woff') format('woff');
  font-weight: 700;
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #fff;
  --black: #000;
  --mint: #4ef8c0;
  --bondiMint: #b2fce4;
}

:root[data-theme="Narwhal"], :root {
  interpolate-size: allow-keywords;
  --global-default-state-border-width: 0.5px;
  --global-default-state-border-radius: 12px;
  --global-typography-font-family: 'Italianplate', Helvetica, Arial, sans-serif;
  --global-hover-state-border-width: 0.0625rem;
  --global-focus-state-outline: none;
  --global-focus-state-box-shadow: 0 0 0 0.0625rem var(--global-focus-state-box-shadow-color);
  --global-focus-state-dark-outline: none;
  --global-focus-state-dark-box-shadow: 0 0 0 0.0625rem var(--global-focus-state-dark-box-shadow-color);
  --global-active-state-box-shadow: none;
  --global-active-state-dark-box-shadow: none;

  --global-hover-state-border-color: #000000;
  --global-hover-state-background-color: linear-gradient(0deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), linear-gradient(0deg, #00D64F, #00D64F);
  --global-hover-state-dark-border-color: #4EF8C1;
  --global-hover-state-dark-background-color: linear-gradient(0deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)), linear-gradient(0deg, #E8E8E8, #E8E8E8);
  --global-hover-outline-state-border-color: #666666;
  --global-focus-state-border-color: #000000;
  --global-focus-state-box-shadow-color: #4EF8C1;
  --global-focus-state-second-box-shadow-color: rgba(0, 214, 79, 0.4);
  --global-focus-state-dark-background: #959595;
  --global-focus-outline-state-border-color: #00D64F;
  --global-focus-state-dark-border-color: #4EF8C1;
  --global-focus-state-dark-box-shadow-color: #000000;
  --global-focus-state-dark-second-box-shadow-color: rgba(0, 0, 0, 0.2);
  --global-active-state-background: #4EF8C1;
  --global-active-state-border-color: #000000;
  --global-active-state-color: #000000;
  --global-active-outline-state-border-color: transparent;
  --global-active-outline-state-background-color: #00a93e;
  --global-active-outline-state-text-color: #1E1E1E;
  --global-active-state-dark-background: #000000;
  --global-active-state-dark-border-color: #000000;
  --global-active-state-dark-color: #FFFFFF;

  --color-semantic-primary: #B2FCE4;
  --color-semantic-primary-hover: #B2FCE4;
  --color-semantic-primary-press: #4EF8C1;
  --color-semantic-primary-focus: #B2FCE4;
  --color-semantic-primary-disabled: #CCCCCC;
  --color-semantic-prominent: #000000;
  --color-semantic-prominent-press: #4EF8C1;
  --color-semantic-prominent-disabled: #CCCCCC;
  --color-semantic-inverse: #FFFFFF;
  --color-semantic-inverse-press: #4EF8C1;
  --color-semantic-inverse-disabled: #CCCCCC;
  --color-semantic-info: #3375C9;
  --color-semantic-info-dark: #0E245B;
  --color-semantic-info-light: #EFF4FB;
  --color-semantic-info-press: #4EF8C1;
  --color-semantic-info-disabled: #CCCCCC;
  --color-semantic-accent-dark: #FFB600;
  --color-semantic-accent-light: #FFF9D9;
  --color-semantic-success: #80D187;
  --color-semantic-success-light: #EDF9DE;
  --color-semantic-success-dark: #368071;
  --color-semantic-error: #CC3300;
  --color-semantic-warning: #FFB600;
  --color-semantic-neutral-black: #1A1A1A;
  --color-semantic-neutral-white: #FFFFFF;
  --color-semantic-neutral-100: #F5F5F5;
  --color-semantic-neutral-150: #F0F0F0;
  --color-semantic-neutral-300: #CCCCCC;

  --avatar-default-background-color: #B2FCE4;
  --avatar-default-text-color: #000000;
  --divider-hairline-border-color: #CCCCCC;
  --button-primary-default-background-color: #B2FCE4;
  --button-primary-default-text-color: #000000;
  --input-text-color: #000000;
  --input-label-default-text-color: #666666;
  --input-default-background-color: #FFFFFF;
  --input-default-border-color: #CCCCCC;
  --input-password-toggle-default-border-color: transparent;

  --color-error: #CC3300;
  --color-error-bg: #FEF3F2;

  /* Standard Mode: Official proportions matching target screenshot */
  --form-width: 396px;
  --radius-input: 12px;
  --radius-btn: 12px;
  --top-padding: 28px;
  --divider-margin: 18px;
  --title-size: 34px;
  --title-margin: 16px;
  --title-line-height: 1.2;
  --label-size: 16px;
  --label-margin: 8px;
  --input-height: 60px;
  --input-font: 16px;
  --input-padding: 0 18px;
  --btn-height: 58px;
  --btn-font: 17px;
  --btn-margin-bottom: 14px;
  --prompt-font: 14px;
  --prompt-margin-top: 16px;
  --prompt-margin-bottom: 16px;
  --retailer-font: 15px;
  --field-group-margin: 16px;
  --avatar-size: 44px;
  --avatar-icon-size: 26px;
  --footer-font: 11px;
  --footer-padding-top: 48px;
}

/* Reset & Base matching official Afterpay portal */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
}

#__next, body, html {
  height: 100vh;
  min-height: 100%;
  background-color: #FFFFFF;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #FFFFFF;
  color: var(--color-semantic-prominent);
  font-family: var(--global-typography-font-family);
  line-height: 1.4;
}

/* Layout container */
.page-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #FFFFFF;
  padding: var(--top-padding) 20px 32px;
}

.login-wrapper {
  width: 100%;
  max-width: var(--form-width);
  margin-top: 0;
  position: relative;
  flex-shrink: 0;
}

/* Header with official logo */
.style_header__Hflh4 {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 6px;
}

.style_headerLogoRow__GKsI4 {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.xr_bf {
  display: block;
}

.xr_xt {
  height: 22px;
  width: 118px;
}

.g1_g6 {
  border: none;
  border-top: 1px solid var(--divider-hairline-border-color);
  margin-top: 8px;
  margin-bottom: var(--divider-margin);
}

.g1_g6 hr {
  display: none;
}

/* Views manager */
.auth-view {
  display: none;
  opacity: 1;
}

.auth-view.active {
  display: block;
}

/* Typography */
.main-title {
  font-size: var(--title-size);
  font-weight: 700;
  color: var(--color-semantic-prominent);
  line-height: var(--title-line-height);
  letter-spacing: -0.025em;
  margin-bottom: var(--title-margin);
}

.main-title.text-center {
  text-align: center;
}

/* Step 2 Profile Card (Matches snippet: .style_profileCard__HGOti) */
.style_profileCard__HGOti {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.co_cu {
  align-items: center;
  border-radius: 50%;
  color: var(--avatar-default-text-color);
  display: flex;
  justify-content: center;
  background: var(--avatar-default-background-color);
  width: var(--avatar-size);
  height: var(--avatar-size);
  flex-shrink: 0;
}

.kc_kf {
  width: var(--avatar-icon-size);
  height: var(--avatar-icon-size);
  display: inline-block;
  line-height: normal;
  vertical-align: middle;
}

.overflow-hidden {
  overflow: hidden;
}

.style_variableColumn__aCdlW {
  overflow: auto;
  scrollbar-width: thin;
  display: flex;
  justify-content: space-between;
}

.user-email-text {
  font-size: var(--input-font);
  font-weight: 700;
  color: var(--color-semantic-prominent);
  word-break: break-all;
  margin: 0;
  line-height: 1.3;
}

.a_c {
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  color: var(--color-semantic-prominent);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  background: none;
  border: none;
  padding: 0;
  margin: 2px 0 0 0;
  text-decoration: underline;
  text-underline-offset: 1.5px;
}

.a_c:hover {
  opacity: 0.75;
}

/* Form controls */
.field-group {
  margin-bottom: var(--field-group-margin);
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: var(--label-size);
  font-weight: 400;
  color: var(--color-semantic-prominent);
  margin-bottom: var(--label-margin);
  letter-spacing: -0.01em;
}

.field-label-step2 {
  font-size: var(--label-size);
  font-weight: 400;
  color: var(--color-semantic-prominent);
  margin-bottom: var(--label-margin);
}

/* Input container */
.input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.text-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  font-size: var(--input-font);
  font-family: inherit;
  color: var(--input-text-color);
  background-color: var(--input-default-background-color);
  border: 1px solid var(--input-default-border-color);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.text-input::placeholder {
  color: #767676;
  font-weight: 400;
  opacity: 1;
}

.text-input:hover:not(:focus):not(.has-error) {
  border-color: #888888;
}

.text-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000;
}

/* Focused styling in Step 2 with Afterpay green focus glow */
.input-container.focused-mint .text-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000, 0 0 0 3px rgba(78, 248, 193, 0.45);
}

.text-input.has-error {
  border-color: var(--color-error);
}

/* Clear button inside input */
.btn-clear-input {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #767676;
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background-color 0.15s;
}

.btn-clear-input svg {
  width: 14px;
  height: 14px;
}

.btn-clear-input:hover {
  color: #000000;
  background-color: #F0F0F0;
}

.input-container.has-value .btn-clear-input {
  display: flex;
}

/* Toggle password visibility */
.btn-toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--color-semantic-prominent);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.btn-toggle-password svg {
  width: 20px;
  height: 20px;
}

.btn-toggle-password:hover {
  opacity: 0.7;
}

.btn-toggle-password .hidden {
  display: none;
}

/* Error message */
.error-msg {
  font-size: var(--label-size);
  color: var(--color-error);
  margin-top: 4px;
  display: none;
  font-weight: 500;
  line-height: 1.3;
}

.error-msg.visible {
  display: block;
}

/* Primary Action Button (#B2FCE4) */
.btn-submit {
  width: 100%;
  height: var(--btn-height);
  background-color: var(--button-primary-default-background-color);
  color: var(--button-primary-default-text-color);
  border: var(--global-hover-state-border-width) solid transparent;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: var(--btn-font);
  font-weight: bold;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover {
  border-color: var(--global-hover-state-border-color);
}

.btn-submit:active {
  background-color: #9cf5d6;
  transform: scale(0.995);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin-left: 8px;
}

.btn-submit.loading .btn-label {
  opacity: 0.8;
}

.btn-submit.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bottom Links in Step 1 */
.signup-prompt {
  font-size: var(--prompt-font);
  text-align: center;
  color: var(--color-semantic-prominent);
  margin-top: var(--prompt-margin-top);
  margin-bottom: var(--prompt-margin-bottom);
  line-height: 1.4;
}

.link-app {
  color: var(--color-semantic-prominent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.link-app:hover {
  opacity: 0.75;
}

.retailer-container {
  display: flex;
  justify-content: center;
}

.link-retailer {
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--retailer-font);
  font-weight: 700;
  color: var(--color-semantic-prominent);
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: none;
  transition: opacity 0.15s ease;
  letter-spacing: -0.01em;
}

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

/* Forgot password link below Continue button */
.forgot-container {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.link-forgot-step2 {
  font-size: var(--retailer-font);
  font-weight: 700;
  color: var(--color-semantic-prominent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}

.link-forgot-step2:hover {
  opacity: 0.75;
}

/* Retailer portal view badge */
.retailer-badge-header {
  margin-bottom: 12px;
}

.badge-merchant {
  display: inline-block;
  background-color: #F0F4F8;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Loading view styles */
.loading-animation-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 28px auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.afterpay-loader-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3.5px solid #F0F0F0;
  border-top-color: #000000;
  border-right-color: #B2FCE4;
  animation: afterpaySpin 0.95s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.loader-logo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes afterpaySpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-desc {
  font-size: var(--label-size);
  color: #666666;
  margin-top: -6px;
  margin-bottom: 24px;
  line-height: 1.45;
}

.progress-bar-container {
  width: 100%;
  height: 5px;
  background-color: #F0F2F4;
  border-radius: 6px;
  overflow: hidden;
  margin: 12px auto 20px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #B2FCE4 0%, #000000 100%);
  border-radius: 6px;
  transition: width 5.5s cubic-bezier(0.15, 0.85, 0.35, 1);
}

.progress-bar-fill.active {
  width: 100%;
}

/* Goodbye view styles ("See you soon!") */
.goodbye-icon-wrapper {
  width: 60px;
  height: 60px;
  background-color: var(--button-primary-default-background-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 20px;
  box-shadow: 0 4px 16px rgba(178, 252, 228, 0.6);
}

.goodbye-desc {
  font-size: var(--label-size);
  color: #555555;
  margin-top: -4px;
  margin-bottom: 26px;
  line-height: 1.5;
}

/* Success view */
.success-icon-wrapper {
  width: 56px;
  height: 56px;
  background-color: var(--button-primary-default-background-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 20px;
}

.success-desc {
  font-size: var(--label-size);
  color: #555555;
  margin-bottom: 24px;
}

/* Official Australian Footer */
.page-footer {
  margin-top: auto;
  padding-top: var(--footer-padding-top);
  padding-bottom: 12px;
  text-align: center;
  font-size: var(--footer-font);
  color: #333333;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.footer-line1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 3px;
}

.footer-link {
  color: #111111;
  text-decoration: underline;
  text-underline-offset: 1.5px;
}

.footer-line2 {
  color: #333333;
}

/* Modal: App download */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 24px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #F4F4F5;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: #E4E4E7;
  color: #000;
}

.brand-pill {
  display: inline-block;
  background-color: var(--button-primary-default-background-color);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
  line-height: 1.3;
}

.modal-text {
  font-size: 13px;
  color: #555555;
  line-height: 1.45;
  margin-bottom: 20px;
}

.qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.qr-code {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.store-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.store-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #000000;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  transition: opacity 0.15s;
}

.store-pill:hover {
  opacity: 0.88;
}

/* Toast alert */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #111111;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

/* Discreet floating demo step bar */
.demo-controls-bar {
  position: fixed;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid #E2E4E8;
  border-radius: 20px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
  z-index: 500;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-label {
  font-size: 10px;
  font-weight: 700;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.btn-ctrl {
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-ctrl.active {
  background: #111111;
  color: #FFFFFF;
}

.btn-ctrl:hover:not(.active) {
  background: #F2F2F2;
  color: #111111;
}

@media (max-width: 480px) {
  .page-container {
    padding: 20px 16px 24px;
  }
  
  .demo-controls-bar {
    bottom: 10px;
    right: 50%;
    transform: translateX(50%);
    white-space: nowrap;
  }
}
