/* =====================================================
   MAIN.CSS — MyCompany SPA Frontend Styles
   ===================================================== */

:root {
  --brand:          #00a8a8;
  --brand-dark:     #007f7f;
  --brand-light:    #e6f7f7;
  --text-primary:   #1a1a1a;
  --text-muted:     #666666;
  --text-light:     #999999;
  --bg-page:        #ffffff;
  --bg-card:        #ffffff;
  --bg-notice:      #f7f7f7;
  --border:         #dddddd;
  --border-focus:   #00a8a8;
  --btn-dark-bg:    #1a1a1a;
  --btn-dark-text:  #ffffff;
  --shadow-card:    0 2px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --radius-card:    12px;
  --radius-input:   8px;
  --radius-btn:     8px;
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --ease:           0.2s ease;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: underline; transition: color var(--ease); }
a:hover { color: var(--brand-dark); }
button { font-family: var(--font); }

/* ----- Layout ----- */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 24px;
  gap: 16px;
}

/* ----- Auth Card ----- */
.auth-card {
  background: var(--bg-card);
  border: 1px solid #e5e5e5;
  border-radius: var(--radius-card);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 480px;
  padding: 40px 44px 36px;
}

/* ----- Progress Bar ----- */
#progress-container {
  display: none;
  width: 100%;
  max-width: 480px;
}
#progress-container.visible { display: block; }

.progress-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-step:not(:last-child) .progress-line {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background 0.4s ease;
}
.progress-step.completed:not(:last-child) .progress-line,
.progress-step.active:not(:last-child) .progress-line {
  background: var(--brand);
}

.progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.progress-step.completed .progress-dot { background: var(--brand); }
.progress-step.active .progress-dot {
  background: var(--brand);
  transform: scale(1.2);
  box-shadow: 0 0 0 5px var(--brand-light);
}

.progress-label {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
  max-width: 64px;
  line-height: 1.3;
}
.progress-step.active .progress-label   { color: var(--brand); font-weight: 600; }
.progress-step.completed .progress-label { color: var(--brand); }

/* ----- Step Containers ----- */
.step { display: none; }
.step.active {
  display: block;
  animation: stepIn 0.32s ease forwards;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ----- Step Typography ----- */
.step-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.step-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* ----- Notice Box ----- */
.notice-box {
  background: var(--bg-notice);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

/* ----- Use Email Row ----- */
.alt-link-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.alt-link-row a { font-size: 13px; }

/* ----- Form ----- */
.form-group { margin-bottom: 14px; position: relative; }

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-light); }
.form-control:hover:not(:focus) { border-color: #bbbbbb; }
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,168,168,0.13);
}

/* password wrapper */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .form-control { padding-right: 58px; }
.pw-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  padding: 4px;
  transition: color var(--ease);
}
.pw-toggle:hover { color: var(--brand-dark); }

/* select */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

/* ----- Checkbox ----- */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease);
}
.check-row input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.check-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.check-row input[type="checkbox"]:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-row label { font-size: 14px; color: var(--text-primary); cursor: pointer; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease), color var(--ease), border-color var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn-block { width: 100%; }

.btn-dark {
  background: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.btn-dark:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  color: #fff;
  text-decoration: none;
}
.btn-dark:active { transform: translateY(0); box-shadow: none; }

.btn-brand {
  background: var(--brand);
  color: #fff;
}
.btn-brand:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,168,168,0.28);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
  text-decoration: none;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--brand);
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.btn-ghost:hover { color: var(--brand-dark); }

.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
  content: '';
  width: 15px;
  height: 15px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Divider ----- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-light);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ----- Social Buttons ----- */
.social-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 22px;
}
.social-btn {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
  padding: 0;
  text-decoration: none;
}
.social-btn:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(0,168,168,0.16);
  transform: translateY(-2px);
}
.social-btn svg { width: 22px; height: 22px; display: block; }

/* ----- Alerts ----- */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  line-height: 1.5;
}
.alert.show { display: block; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info    { background: var(--brand-light); border: 1px solid rgba(0,168,168,0.3); color: var(--brand-dark); }

/* ----- Help Text ----- */
.help-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* ----- OTP Inputs ----- */
.otp-info {
  background: var(--bg-notice);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.otp-info svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }

.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}
.otp-digit {
  width: 50px;
  height: 58px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  color: var(--text-primary);
  background: #fff;
  caret-color: var(--brand);
}
.otp-digit:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,168,168,0.13);
}
.otp-digit.filled { border-color: var(--brand); }

.resend-row {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
#phone-resend-btn, #email-resend-btn { display: none; }
.method-alt {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ----- Authenticator / QR ----- */
.qr-wrapper {
  text-align: center;
  padding: 8px 0 20px;
}
.qr-wrapper img {
  width: 160px;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.totp-secret {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--bg-notice);
  padding: 6px 14px;
  border-radius: 4px;
  color: var(--text-primary);
  letter-spacing: 2px;
  display: inline-block;
}

/* ----- Billing ----- */
.card-preview {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  min-height: 148px;
}
.card-preview::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.card-preview::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -20px;
  width: 130px; height: 130px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
#card-number-display {
  font-size: 18px;
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
  margin-bottom: 20px;
  opacity: 0.92;
  position: relative;
  z-index: 1;
}
.card-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}
#card-name-display, #card-expiry-display {
  font-size: 13px;
  opacity: 0.8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ----- Document Upload ----- */
.doc-block { margin-bottom: 20px; }
.doc-block-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
  background: var(--bg-notice);
  position: relative;
  overflow: hidden;
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--brand);
  background: var(--brand-light);
}
.drop-zone svg.upload-icon {
  width: 40px; height: 40px;
  color: var(--text-light);
  margin-bottom: 10px;
  transition: color var(--ease);
}
.drop-zone:hover svg.upload-icon, .drop-zone.over svg.upload-icon { color: var(--brand); }
.drop-zone .drop-label { font-size: 13px; color: var(--text-muted); }
.drop-zone .drop-label strong { color: var(--brand); }
.drop-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }

.file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}
.file-preview.show { display: flex; }
.file-thumb {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-notice);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--text-light); }
.file-remove { background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px; transition: color var(--ease); }
.file-remove:hover { color: #dc2626; }

.upload-bar-wrap { display: none; margin-top: 8px; }
.upload-bar-wrap.show { display: block; }
.upload-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.upload-bar-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
.upload-bar-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ----- Success Screen ----- */
.success-wrap { text-align: center; padding: 16px 0; }
.success-circle {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success-circle svg { width: 38px; height: 38px; color: #fff; }
.success-wrap .step-title { text-align: center; }
.success-wrap .step-sub { text-align: center; }
.steps-summary {
  background: var(--bg-notice);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 24px;
  text-align: left;
}
.summary-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-primary);
}
.summary-item svg { width: 17px; height: 17px; color: var(--brand); flex-shrink: 0; }

/* ----- Page Footer ----- */
.page-footer {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px solid #f0f0f0;
  width: 100%;
  margin-top: auto;
}
.page-footer a { color: var(--text-light); }

/* ----- Spinner Overlay ----- */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.overlay.show { display: flex; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ----- Responsive ----- */
@media (max-width: 540px) {
  .auth-card { padding: 32px 24px 28px; }
  .step-title { font-size: 26px; }
  .otp-inputs { gap: 7px; }
  .otp-digit { width: 44px; height: 52px; font-size: 21px; }
  .two-col, .three-col { grid-template-columns: 1fr; gap: 0; }
  .progress-label { display: none; }
  .social-row { gap: 10px; }
}
@media (max-width: 380px) {
  .auth-card { padding: 24px 16px 20px; }
  .otp-digit { width: 38px; height: 46px; font-size: 18px; }
}
