/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Safe area for notched devices */
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
  background: #1a1a1a;
  max-width: 430px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Screen Container ===== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  display: none;
  flex-direction: column;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: flex;
}

/* ===== Splash Screen ===== */
#splash {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.splash-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #a8b5e8 0%, #8b9ad6 30%, #6b7bc9 60%, #5647e3 100%);
}

.splash-logo {
  position: relative;
  z-index: 1;
  width: 180px;
  height: auto;
  max-width: 70vw;
}

/* ===== Language Screen ===== */
#language {
  background: #5647e3;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
}

.lang-bg {
  position: absolute;
  inset: 0;
  background: #5647e3;
}

.lang-logo {
  position: relative;
  z-index: 1;
  width: 140px;
  height: auto;
  margin-bottom: 2rem;
}

.lang-title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.lang-subtitle {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
}

.lang-toggle {
  position: relative;
  z-index: 1;
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.lang-option {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #555;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.lang-option:first-child {
  border-radius: 10px 0 0 10px;
}

.lang-option:last-child {
  border-radius: 0 10px 10px 0;
}

.lang-option.active {
  background: #8b7ce8;
  color: #fff;
}

.lang-footer {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}

.lang-footer p {
  margin: 0.2rem 0;
}

/* ===== Login Screen ===== */
#login {
  background: #282828;
  padding: 0;
}

.login-header {
  flex: 0 0 auto;
  width: 100%;
  max-height: 50vh;
  overflow: hidden;
}

.login-header-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.login-card {
  flex: 1;
  background: #fff;
  border-radius: 28px 28px 0 0;
  margin-top: -24px;
  padding: 2rem 1.5rem 3rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  position: relative;
  z-index: 3;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #212121;
  margin-bottom: 1.5rem;
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #212121;
  margin-bottom: 0.5rem;
}

.input-row {
  display: flex;
  gap: 8px;
}

.country-code {
  flex: 0 0 110px;
  padding: 12px 28px 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #f0f0f0;
  color: #333;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.form-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #f0f0f0;
}

.form-input-password {
  width: 100%;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
}

.form-input::placeholder {
  color: #999;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 1.5rem 0 1rem;
}

.btn-login {
  flex: 0 0 auto;
  min-width: 140px;
  padding: 16px 36px;
  background: linear-gradient(90deg, #5647e3 0%, #6b5ce7 50%, #7d6ef0 100%);
  border: none;
  border-radius: 28px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(86, 71, 227, 0.4);
}

.btn-login:active {
  transform: scale(0.98);
}

.link-forgot {
  color: #4285F4;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.link-forgot:hover {
  text-decoration: underline;
}

.register-prompt {
  font-size: 0.9rem;
  color: #212121;
}

.link-register {
  color: #4285F4;
  font-weight: 600;
  text-decoration: none;
}

.link-register:hover {
  text-decoration: underline;
}

/* ===== OTP Screen ===== */
#otp {
  background: #5647e3;
  padding: 0;
}

.otp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  position: relative;
  z-index: 2;
}

.btn-back, .btn-change {
  padding: 8px 18px;
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.otp-illustration {
  flex: 0 0 auto;
  padding: 0.5rem 1rem 1rem;
  max-height: 38vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.otp-illustration img {
  max-width: 100%;
  max-height: 38vh;
  object-fit: contain;
}

.otp-card {
  flex: 1;
  background: #fff;
  border-radius: 28px 28px 0 0;
  margin-top: 0;
  padding: 2.5rem 1.5rem 3.5rem;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
}

.otp-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
}

.otp-instruction {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.otp-inputs {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.otp-input {
  width: 54px;
  height: 54px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #1a1a1a;
  background: #fff;
}

.otp-input:focus {
  outline: none;
  border-color: #5647e3;
}

.otp-resend {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.link-resend {
  color: #4285F4;
  font-weight: 500;
  text-decoration: underline;
}

.link-resend:hover {
  color: #3367d6;
}

.btn-verify {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(90deg, #5647e3 0%, #6b5ce7 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(86, 71, 227, 0.4);
}

.btn-verify:active {
  transform: scale(0.98);
}

.otp-sent {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

.phone-masked {
  color: #4285F4;
  font-weight: 700;
}

/* ===== Forgot Password Screen ===== */
#forgot {
  background: #5647e3;
  padding: 0;
}

.forgot-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0 2rem;
  min-height: 180px;
}

.padlock-emoji {
  font-size: 120px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.forgot-card {
  flex: 1;
  background: #fff;
  border-radius: 28px 28px 0 0;
  margin-top: 0;
  padding: 2rem 1.5rem 3rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.forgot-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.forgot-instruction {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.forgot-form .form-group {
  margin-bottom: 1.25rem;
}

.forgot-form .form-input {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
}

.forgot-form .form-input::placeholder {
  color: #999;
}

.btn-submit {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(90deg, #5647e3 0%, #6b5ce7 50%, #7d6ef0 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(86, 71, 227, 0.35);
}

.btn-submit:active {
  transform: scale(0.98);
}

.forgot-back {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.link-back-login {
  color: #4285F4;
  font-weight: 500;
  text-decoration: underline;
}

.link-back-login:hover {
  color: #3367d6;
}

/* ===== Data attributes for navigation ===== */
[data-goto] {
  cursor: pointer;
}
