/* ===== Login Page – Zimoo ===== */
:root {
  --login-bg: #ffffff;
  --login-text: #000000;
  --login-muted: #8a8a8a;
  --login-placeholder: #c4c4c4;
  --login-border: #e5e5e5;
  --login-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --login-max: 390px;
}

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

html,
body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ffffff;
  color: var(--login-text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

a {
  color: #666666;
  text-decoration: underline;
}

.login-app {
  width: 100%;
  max-width: var(--login-max);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--login-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.login-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.login-screen.active {
  display: flex;
}

.login-topbar {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 50px;
}

.login-back-btn {
  width: 32px;
  height: 32px;
  margin-left: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--login-text);
}

.login-back-btn:active {
  opacity: 0.6;
}

/* Brand – phone screen only */
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-brand-mark {
  width: auto;
  height: 52px;
  max-width: 220px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.login-brand-mark .zimoo-logo-img {
  height: 255px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: contain;
}

.login-content {
  flex: 1;
  text-align: center;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: #000000;
}

.login-subtitle {
  font-size: 14px;
  color: var(--login-muted);
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 400;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.login-otp-phone {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.01em;
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--login-card-shadow);
  padding: 18px 16px 16px;
  text-align: left;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--login-muted);
  margin-bottom: 12px;
}

.login-phone-field {
  display: flex;
  align-items: center;
  height: 52px;
  border: 1px solid var(--login-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.login-country {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 100%;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-right: 1px solid var(--login-border);
}

.login-flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
}

.login-flag svg {
  width: 100%;
  height: 100%;
}

.login-chevron {
  display: flex;
  align-items: center;
  color: #999;
  margin-left: 2px;
}

.login-phone-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 400;
  color: var(--login-text);
}

.login-phone-input::placeholder {
  color: var(--login-placeholder);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--login-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: lowercase;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--login-border);
}

.login-google-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--login-border);
  border-radius: 12px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.login-google-btn:active {
  background: #f8f8f8;
  border-color: #d0d0d0;
  transform: scale(0.98);
}

.login-google-btn-disabled,
.login-google-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.login-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
}

.login-google-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.login-otp-input {
  width: 46px;
  height: 52px;
  border: 1.5px solid var(--login-border);
  border-radius: 12px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--login-text);
  background: #fff;
  caret-color: var(--login-text);
  padding: 0;
}

.login-otp-input:focus,
.login-otp-input.focused {
  border-color: #000000;
  border-width: 2px;
}

.login-otp-timer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--login-muted);
  font-weight: 400;
}

.login-otp-timer strong {
  color: #000000;
  font-weight: 700;
}

.login-footer {
  margin-top: auto;
  padding-top: 28px;
  padding-bottom: 8px;
}

.login-primary-btn {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  background: #000000;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-primary-btn:disabled {
  background: #000000;
  opacity: 0.35;
  cursor: not-allowed;
}

.login-primary-btn:not(:disabled):active {
  opacity: 0.85;
}

.login-legal {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--login-muted);
  line-height: 1.55;
  padding: 0 8px;
}

.login-legal a {
  color: #666666;
  font-weight: 400;
}

.login-resend {
  margin-top: 16px;
  text-align: center;
}

.login-resend-question {
  display: block;
  font-size: 13px;
  color: var(--login-muted);
  margin-bottom: 6px;
}

.login-resend-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  text-decoration: underline;
  padding: 0;
}

.login-resend-btn:disabled {
  color: var(--login-muted);
  text-decoration: none;
  cursor: not-allowed;
}

/* OTP screen spacing */
.login-screen-otp .login-topbar {
  margin-bottom: 24px;
}

.login-screen-otp .login-title {
  margin-bottom: 10px;
}

.login-screen-otp .login-subtitle {
  margin-bottom: 28px;
}

.login-inline-msg {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: #138808;
}

.login-inline-msg.is-error {
  color: #b42318;
}

/* Login full-page loading – Google + mobile OTP + logout */
.zimoo-auth-loading,
.login-google-loading {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.zimoo-auth-loading-inner,
.login-page-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.zimoo-auth-loading-text,
.login-page-loading-text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #444;
  text-align: center;
}

body.zimoo-auth-loading-active,
body.login-page-loading-active {
  overflow: hidden;
}

.zimoo-auth-loading[hidden],
.login-google-loading[hidden] {
  display: none !important;
}

@media (max-width: 380px) {
  .login-screen {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .login-title {
    font-size: 22px;
  }

  .login-otp-input {
    width: 40px;
    height: 46px;
    font-size: 16px;
  }

  .login-otp-row {
    gap: 6px;
  }
}
