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

:root {
  --primary-color: #E03B74;
  --primary-hover: #c4265d;
  --primary-light: #FFF0F3;
  --text-dark: #222222;
  --text-muted: #777777;
  --border-color: #E0E0E0;
  --input-focus: #FFA4BD;
  --white: #FFFFFF;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-text-size-adjust: none;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text-dark);
  background: transparent;
}

/* auth-main: Centering outer container, top-aligned, customizable background */
.auth-main {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 20px;
  background: transparent;
  clear: both;
}

/* auth-card: Responsive card design, natural height expansion */
.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--white);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  padding: 32px;
  height: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* auth-form: Layout container inside the card */
.auth-form {
  width: 100%;
}

.auth-form .page-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-dark);
}

.input-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background-color: #FAFAFA;
  transition: all var(--transition-fast);
}

.input-group:focus-within {
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(224, 59, 116, 0.15);
}

/* Phone Selector & Input Group */
.phone-group {
  display: flex;
  align-items: center;
  width: 100%;
}

.phone-prefix {
  position: relative;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  height: 48px;
  border-right: 1px solid var(--border-color);
  flex: 0 0 auto;
}

.phone-prefix select {
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
  padding-right: 16px;
  -webkit-appearance: none;
  appearance: none;
  max-width: 90px;
}

.phone-prefix::after {
  content: '';
  display: inline-block;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
  pointer-events: none;
}

.phone-group input[type="tel"] {
  flex: 1;
  border: none;
  background: transparent;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  width: 100%;
  color: var(--text-dark);
}

/* Password Input Group */
.password-group input[type="password"],
.password-group input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  color: var(--text-dark);
}

.password-toggle {
  padding: 0 16px;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--primary-hover);
}

/* Forgot Password Link */
.forgot-link-container {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 24px;
}

.forgot-link-container a,
a.small {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.forgot-link-container a:hover,
a.small:hover {
  color: var(--primary-color);
}

/* Confirm & Button styling */
.confirmArea {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  width: auto;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  position: relative;
}

.primary-btn {
  background: var(--primary-color);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(224, 59, 116, 0.2);
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(224, 59, 116, 0.3);
  color: rgba(255, 255, 255, 0.5) !important;
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled,
.primary-btn.disabled {
  background: #E0E0E0;
  color: #999999;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.border-btn {
  border: 1.5px solid var(--border-color);
  background: var(--white);
  color: var(--text-dark);
}

.border-btn:hover {
  border-color: var(--text-dark);
  background-color: #FAFAFA;
}

/* Social icons in buttons */
.btn .icon {
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  left: 20px;
}

.ic-mobile { background-image: url('https://img.ipimg.com/images/index/images/login/login_phone.png'); }
.logo-apple { background-image: url('https://img.ipimg.com/images/index/images/login/logo_apple.png'); }
.logo-google { background-image: url('https://img.ipimg.com/images/index/images/login/logo_google.png'); }

/* Divider styling */
.divi {
  display: flex;
  align-items: center;
  margin: 24px 0;
  gap: 12px;
}

.divi .line {
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.divi .text {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Bottom prompts */
.bottom-links {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.register-prompt {
  font-size: 15px;
  color: var(--text-muted);
}

.register-prompt a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  transition: color var(--transition-fast);
}

.register-prompt a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* OTP Specific styles */
.otp-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.otp-subtitle {
  font-size: 17px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.otp-info {
  font-size: 17px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

.otp-info .phone-number {
  color: var(--primary-color);
  font-weight: 700;
}

.otp-info-sub {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.otp-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0;
}

.otp-container input {
  width: 100%;
  height: 48px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background-color: #FAFAFA;
  color: var(--primary-color);
  outline: none;
  transition: all var(--transition-fast);
}

.otp-container input:focus {
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(224, 59, 116, 0.15);
}

.resend-section {
  text-align: center;
  margin-bottom: 24px;
  font-size: 15px;
}

.timer-text {
  color: var(--text-muted);
}

.countdown-seconds {
  color: var(--primary-color);
  font-weight: 600;
}

.resend-tip {
  color: var(--text-muted);
}

.resend-tip a.btn-resend {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.resend-tip a.btn-resend:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.resend-tip a.btn-resend.disabled {
  color: #CCCCCC;
  cursor: not-allowed;
  pointer-events: none;
}

.otp-back {
  text-align: center;
  margin-top: 16px;
}

.otp-back a {
  color: var(--text-muted);
  font-size: 15px;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.otp-back a:hover {
  color: var(--primary-color);
}

/* Forgot Password / Reset Password Descriptions */
.form-desc {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.back-to-login {
  display: block;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  margin-top: 16px;
  transition: color var(--transition-fast);
}

.back-to-login:hover {
  color: var(--primary-color);
}

/* Error/Alert Banner Style */
.alert-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #FFF9E6;
  border: 1px solid #FFE082;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
  animation: shake 0.2s ease-in-out 2;
}

.alert-box .alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-image: url('https://img.ipimg.com/images/index/images/warning_icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.alert-box .alert-text {
  font-size: 15px;
  color: #664d03;
  font-weight: 500;
  line-height: 1.5;
}

/* Agreement Text Styling */
.agreement-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 16px;
  padding: 0 4px;
}

.agreement-text a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.agreement-text a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Micro-animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.2s ease-in-out 2;
}

/* Responsive adjustments for auth card padding */
@media (max-width: 576px) {
  .auth-main {
    padding: 24px 20px;
  }
  .auth-card {
    padding: 24px;
  }
}

@media (max-width: 500px) {
  .auth-card {
    background: none;
    border: none;
    box-shadow: none;
    padding: 16px 0;
  }
}

/* Status message view styling */
.auth-msg-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0 8px 0;
}

.auth-msg-img-box {
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-msg-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.auth-msg-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  line-height: 1.4;
}

.auth-desc {
  font-size: 16px;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Custom Phone Prefix Selector */
.custom-select-container {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 48px;
}

.custom-select-trigger {
  width: 100%;
  height: 100%;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus {
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(224, 59, 116, 0.1);
}

.custom-select-trigger .flag-emoji {
  font-size: 24px;
  line-height: 1;
}

.custom-select-trigger .arrow-down {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #718096;
  margin-left: 4px;
}

.custom-select-dropdown {
  position: absolute;
  top: 54px;
  left: 0;
  width: 320px; /* wider dropdown to display info */
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 100;
  overflow: hidden;
  padding: 6px 0;
}

.custom-select-dropdown.show {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 15px;
  color: var(--text-dark);
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: #f7fafc;
}

.custom-select-option .opt-flag {
  font-size: 20px;
  margin-right: 12px;
  display: inline-block;
  width: 24px;
  text-align: center;
}

.custom-select-option .opt-name {
  flex: 1;
  font-weight: 500;
  color: #2d3748;
  text-align: left;
}

.custom-select-option .opt-code {
  font-weight: 600;
  color: #4a5568;
  margin-left: 12px;
}

/* Override custom select trigger styles inside .phone-prefix to prevent double border and double arrow */
.phone-prefix .custom-select-container {
  width: 52px;
  height: 100%;
}

.phone-prefix .custom-select-trigger {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  height: 100%;
  justify-content: flex-start;
}

.phone-prefix .custom-select-trigger:hover,
.phone-prefix .custom-select-trigger:focus {
  border: none;
  background: transparent;
  box-shadow: none;
}

.phone-prefix .custom-select-trigger .arrow-down {
  display: none;
}

/* APP Webview Button Style */
.btn.app-btn {
  background-color: #e68eb6;
  color: var(--white, #ffffff);
  border: none;
}

.btn.app-btn:hover {
  background-color: #df7fa9;
}

/* APP Webview Plain Text Button Style */
.btn-text {
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: opacity 0.2s ease;
}

.btn-text:hover {
  opacity: 0.8;
}

.app-logout-btn {
  color: #888888;
  margin-top: 8px;
}

/* Terms Agreement Checkbox Style */
.terms-agree-box {
  background-color: #F7F7F9;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  text-align: left;
  width: 100%;
}

.terms-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  color: #333333;
  line-height: 1.4;
  user-select: none;
  width: 100%;
}

.terms-label input[type="checkbox"] {
  display: none;
}

.checkbox-box {
  width: 24px;
  height: 24px;
  border: 2px solid #D6D6D6;
  border-radius: 8px; /* Rounded corners matching Squircle */
  margin-right: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background-color: #FFFFFF;
  box-sizing: border-box;
}

.terms-label input[type="checkbox"]:checked + .checkbox-box {
  background-color: #E68EB6;
  border-color: #E68EB6;
}

.terms-label input[type="checkbox"]:checked + .checkbox-box::after {
  content: "";
  width: 6px;
  height: 12px;
  border: solid #FFFFFF;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  margin-bottom: 3px;
  box-sizing: border-box;
}

.pink-link {
  color: #E68EB6;
  text-decoration: none;
  font-weight: 500;
}

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

/* Disabled button state */
.btn.disabled, .btn:disabled {
  background-color: #E0E0E0 !important;
  color: #A0A0A0 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Compact description override */
.auth-desc.auth-desc-compact {
  margin-bottom: 12px;
}
