/* ==========================================================
   M1M Theme - Exact Colors, Background & Fonts from m1m.org
   Background: #1A1B1A / #2F312F
   Fonts: 'Roboto', 'Lato', Sans-serif
   Heading Color: #FFFFFF
   Text / Secondary: #979DA2
   Accents: #E7D5AD, #A96536, #8C6A3F
   Button: linear-gradient(180deg, #E7D5AD 0%, #A96536 100%) (#212529 text)
   ========================================================== */

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #1a1b1a;
  background-image: radial-gradient(circle at 50% 0%, #2f312f 0%, #1a1b1a 75%);
  font-family: 'Roboto', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient Warm Glow Effects inspired by M1M Gold */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.glow-top {
  top: -120px;
  right: 20%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(231, 213, 173, 0.22) 0%, rgba(169, 101, 54, 0.1) 60%, transparent 80%);
}

.glow-bottom {
  bottom: -140px;
  left: 20%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(140, 106, 63, 0.25) 0%, rgba(26, 27, 26, 0.05) 60%, transparent 80%);
}

/* Main Card */
.card-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  animation: cardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  background: #242624;
  border: 1px solid rgba(140, 106, 63, 0.35);
  border-radius: 24px;
  padding: 38px 32px 30px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 1px rgba(231, 213, 173, 0.25);
  text-align: center;
}

/* Brand Header */
.brand-header {
  margin-bottom: 24px;
}

.brand-logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: #171817;
  border: 1px solid rgba(140, 106, 63, 0.45);
  margin-bottom: 16px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(231, 213, 173, 0.08);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding: 6px;
}

.brand-logo-wrapper:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(231, 213, 173, 0.6);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  letter-spacing: -0.01em;
  font-family: 'Roboto', sans-serif;
}

.subtitle {
  margin: 0;
  color: #979da2;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
}

.subtitle strong {
  color: #e7d5ad;
  font-weight: 600;
}

/* Form Styles */
.auth-form {
  text-align: left;
}

/* Structured Label */
.field-label-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.input-label {
  font-size: 14px;
  font-weight: 600;
  color: #e7d5ad;
  letter-spacing: 0.02em;
}

.label-info-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #8c6a3f;
  background: rgba(140, 106, 63, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(140, 106, 63, 0.35);
}

/* Unified Modern Phone Input Box */
.unified-phone-wrapper {
  position: relative;
}

.unified-phone-box {
  display: flex;
  align-items: center;
  background: #171817;
  border: 1.5px solid #3d403d;
  border-radius: 14px;
  padding: 4px 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.unified-phone-box:hover {
  border-color: #574731;
  background: #1b1c1b;
}

.unified-phone-box:focus-within,
.unified-phone-box.has-open-dropdown {
  border-color: #e7d5ad;
  background: #1f211f;
  box-shadow: 0 0 0 3.5px rgba(231, 213, 173, 0.2), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.country-picker-btn {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 10px;
  outline: none;
  transition: background 0.15s;
  flex-shrink: 0;
}

.country-picker-btn:hover,
.country-picker-btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.country-flag-slot {
  display: flex;
  align-items: center;
  line-height: 1;
}

.country-flag-img,
.flag-img {
  width: 20px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}

.flag-text-fallback {
  font-size: 15px;
  line-height: 1;
}

.selected-code {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.dropdown-chevron {
  color: #979da2;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.has-open-dropdown .dropdown-chevron {
  transform: rotate(180deg);
  color: #e7d5ad;
}

.input-vertical-divider {
  width: 1px;
  height: 24px;
  background: #3d403d;
  margin: 0 6px 0 2px;
  flex-shrink: 0;
}

.phone-text-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  outline: none;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.phone-text-input::placeholder {
  color: #697076;
  font-weight: 400;
  letter-spacing: normal;
}

/* Helper Text */
.input-helper-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #979da2;
  margin-top: 8px;
}

.input-helper-text svg {
  color: #8c6a3f;
  flex-shrink: 0;
}

/* Searchable Country Dropdown Popover */
.country-dropdown-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1f211f;
  border: 1px solid #574731;
  border-radius: 18px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 1px rgba(231, 213, 173, 0.2);
  z-index: 100;
  display: none;
  overflow: hidden;
  text-align: left;
}

.country-dropdown-popover.is-open {
  display: block;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  border-bottom: 1px solid #2d2f2d;
  background: #191b19;
}

.country-search-box {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #191b19;
}

.search-icon {
  color: #979da2;
  flex-shrink: 0;
}

.country-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
  color: #ffffff;
  font-family: inherit;
  font-weight: 500;
}

.country-search-box input::placeholder {
  color: #697076;
  font-weight: 400;
}

.clear-search-btn {
  border: none;
  background: #2a2c2a;
  color: #979da2;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.clear-search-btn:hover {
  background: #383a38;
  color: #ffffff;
}

/* Country List */
.country-list {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0;
}

.country-list::-webkit-scrollbar {
  width: 5px;
}

.country-list::-webkit-scrollbar-thumb {
  background: #484b48;
  border-radius: 999px;
}

.country-section-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8c6a3f;
  letter-spacing: 0.05em;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background-color 0.12s;
  font-size: 13.5px;
  color: #e2e4e6;
  font-weight: 400;
}

.country-item:hover,
.country-item:focus {
  background-color: #2b2d2b;
  color: #ffffff;
  outline: none;
}

.country-item.is-active {
  background-color: rgba(231, 213, 173, 0.15);
  font-weight: 600;
  color: #e7d5ad;
}

.country-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-code-pill {
  font-size: 12px;
  color: #e7d5ad;
  font-weight: 600;
  background: #2b2d2b;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(140, 106, 63, 0.3);
}

.country-item.is-active .country-code-pill {
  background: #8c6a3f;
  color: #ffffff;
}

.country-empty {
  padding: 28px 16px;
  text-align: center;
  color: #979da2;
}

.country-empty svg {
  margin-bottom: 8px;
  color: #484b48;
}

.country-empty p {
  font-size: 13px;
  margin: 0;
}

/* Primary Action Button (M1M Signature Gold Gradient) */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  background-image: linear-gradient(180deg, #e7d5ad 0%, #a96536 100%);
  color: #212529;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(169, 101, 54, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 22px;
  font-family: 'Roboto', Sans-serif;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -4px rgba(231, 213, 173, 0.55);
  filter: brightness(1.08);
}

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

.btn-arrow-icon {
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow-icon {
  transform: translateX(3px);
}

/* Error Banner */
.error-banner {
  background: rgba(207, 46, 46, 0.15);
  border: 1px solid rgba(207, 46, 46, 0.4);
  color: #ff8a8a;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.error-banner svg {
  flex-shrink: 0;
}

/* Card Footer Security Note */
.card-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: #979da2;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #333633;
  font-weight: 400;
}

.card-footer-note svg {
  color: #8c6a3f;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e7d5ad;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s;
}

.back-link:hover {
  color: #ffffff;
}

/* ==========================================================
   Dummy / Demo OTP Banner inside OTP Page
   ========================================================== */
.demo-otp-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(231, 213, 173, 0.08);
  border: 1px solid rgba(140, 106, 63, 0.45);
  border-radius: 14px;
  padding: 10px 18px;
  margin-bottom: 22px;
  box-shadow: inset 0 0 12px rgba(231, 213, 173, 0.04);
}

.demo-otp-tag {
  font-size: 11px;
  font-weight: 700;
  color: #8c6a3f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-otp-code {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #e7d5ad;
  font-family: 'Roboto Mono', monospace, 'Roboto';
}

/* OTP Boxes (M1M Theme) */
.otp-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 24px;
}

.otp-box {
  width: 56px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  border-radius: 14px;
  background: #171817;
  border: 1.5px solid #3d403d;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.otp-box:focus {
  border-color: #e7d5ad;
  background: #1f211f;
  box-shadow: 0 0 0 3.5px rgba(231, 213, 173, 0.25);
}

.resend-form {
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: #e7d5ad;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  transition: all 0.15s;
}

.link-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Profile Actions */
.btn-danger {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  background: transparent;
  color: #cf2e2e;
  border: 1.5px solid rgba(207, 46, 46, 0.4);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-danger:hover {
  background: rgba(207, 46, 46, 0.12);
  border-color: #cf2e2e;
}

.delete-form {
  margin-top: 14px;
}

/* User Profile Box (M1M Theme) */
.user-profile-box {
  background: #191b19;
  border: 1px solid rgba(140, 106, 63, 0.4);
  border-radius: 18px;
  padding: 24px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.user-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(231, 213, 173, 0.12);
  border: 2px solid #8c6a3f;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.user-avatar-circle span {
  font-size: 26px;
  font-weight: 700;
  color: #e7d5ad;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.profile-phone {
  font-size: 14px;
  color: #979da2;
  margin: 0;
  font-weight: 500;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(140, 106, 63, 0.15);
  border: 1px solid rgba(140, 106, 63, 0.35);
  color: #e7d5ad;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.verified-pill svg {
  color: #e7d5ad;
}

/* Card Footer Note & Terms Link */
.card-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  color: #979da2;
  font-size: 12.5px;
  font-weight: 500;
}

.card-footer-note svg {
  color: #c59b63;
  flex-shrink: 0;
}

.terms-link {
  color: #979da2;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(140, 106, 63, 0.4);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.terms-link:hover {
  color: #e7d5ad;
  text-decoration-color: #e7d5ad;
  text-shadow: 0 0 10px rgba(231, 213, 173, 0.35);
}

/* ==========================================================================
   Profile Actions & Delete Confirmation Modal
   ========================================================================== */
.profile-actions-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.profile-actions-group .btn-primary {
  margin-top: 0;
}

.profile-actions-group form {
  width: 100%;
}

.btn-delete-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-delete-trigger svg {
  color: currentColor;
  transition: transform 0.2s ease;
}

.btn-delete-trigger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-delete-trigger:hover svg {
  transform: scale(1.1);
}

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

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Card */
.modal-card {
  background: #242624;
  border: 1px solid rgba(140, 106, 63, 0.4);
  border-radius: 20px;
  padding: 32px 28px 26px;
  max-width: 410px;
  width: 100%;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  margin: auto;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75),
              0 0 32px rgba(140, 106, 63, 0.15);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active .modal-card {
  transform: scale(1) translateY(0);
}

/* Modal Icon Badges */
.modal-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.modal-icon-badge.logout-badge {
  background: rgba(231, 213, 173, 0.12);
  border: 1px solid rgba(140, 106, 63, 0.45);
  color: #e7d5ad;
  box-shadow: 0 0 24px rgba(231, 213, 173, 0.18);
}

.modal-icon-badge.danger-badge {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.22);
}

.modal-title {
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.55;
  color: #979da2;
  margin: 0 0 24px;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-action-form {
  flex: 1;
  margin: 0;
}

.btn-modal-cancel {
  flex: 1;
  padding: 13px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-modal-logout-confirm {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  background-image: linear-gradient(180deg, #e7d5ad 0%, #a96536 100%);
  border: none;
  color: #212529;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(169, 101, 54, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-modal-logout-confirm:hover {
  box-shadow: 0 6px 22px rgba(231, 213, 173, 0.55);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-modal-logout-confirm:active {
  transform: translateY(0);
}

.btn-modal-confirm {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-modal-confirm:hover {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

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

/* ==========================================================================
   Responsive Design Across All Devices & Form Factors
   ========================================================================== */

/* Tablets and small laptops (up to 768px) */
@media (max-width: 768px) {
  .ambient-glow {
    filter: blur(80px);
    opacity: 0.28;
  }
  .glow-top {
    width: 320px;
    height: 320px;
  }
  .glow-bottom {
    width: 340px;
    height: 340px;
  }
}

/* Standard Mobile Devices (up to 480px) */
@media (max-width: 480px) {
  body {
    padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .card-container {
    max-width: 100%;
  }

  .card {
    padding: 28px 18px 24px;
    border-radius: 20px;
  }

  .brand-header {
    margin-bottom: 18px;
  }

  .brand-logo-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .subtitle {
    font-size: 13.5px;
  }

  /* User Profile Box */
  .user-profile-box {
    padding: 18px 16px;
    margin-bottom: 18px;
    border-radius: 16px;
  }

  .user-avatar-circle {
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
  }

  .user-avatar-circle span {
    font-size: 22px;
  }

  .profile-name {
    font-size: 18px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .profile-phone {
    font-size: 13px;
    word-break: break-all;
  }

  /* Profile Actions */
  .profile-actions-group {
    margin-top: 14px;
    gap: 10px;
  }

  .btn-primary {
    padding: 13px 18px;
    font-size: 14px;
    border-radius: 12px;
  }

  .btn-delete-trigger {
    padding: 12px 18px;
    font-size: 13.5px;
    border-radius: 12px;
  }

  /* OTP Screen Mobile */
  .otp-row {
    gap: 8px;
    margin: 10px 0 20px;
  }

  .otp-box {
    width: 48px;
    height: 54px;
    font-size: 22px;
    border-radius: 12px;
  }

  .demo-otp-banner {
    padding: 8px 12px;
    gap: 8px;
    margin-bottom: 16px;
  }

  .demo-otp-code {
    font-size: 18px;
    letter-spacing: 3px;
  }

  /* Modals Mobile */
  .modal-card {
    padding: 26px 18px 22px;
    border-radius: 18px;
    max-width: 95%;
  }

  .modal-icon-badge {
    width: 50px;
    height: 50px;
    margin-bottom: 14px;
  }

  .modal-icon-badge svg {
    width: 22px;
    height: 22px;
  }

  .modal-title {
    font-size: 19px;
    margin-bottom: 8px;
  }

  .modal-text {
    font-size: 13.5px;
    margin-bottom: 20px;
  }

  .modal-actions {
    gap: 10px;
  }

  .btn-modal-cancel,
  .btn-modal-logout-confirm,
  .btn-modal-confirm {
    padding: 12px 14px;
    font-size: 13.5px;
    border-radius: 10px;
  }

  /* Footer Links */
  .card-footer-note {
    font-size: 11px;
    margin-top: 18px;
    padding-top: 14px;
  }
}

/* Extra Small Mobile Devices (e.g. iPhone SE, 320px - 360px) */
@media (max-width: 360px) {
  .card {
    padding: 22px 14px 18px;
    border-radius: 18px;
  }

  .brand-logo-wrapper {
    width: 62px;
    height: 62px;
    margin-bottom: 10px;
  }

  h1 {
    font-size: 21px;
  }

  .subtitle {
    font-size: 12.5px;
  }

  .country-picker-btn {
    padding: 6px 6px;
    gap: 4px;
  }

  .selected-code {
    font-size: 13px;
  }

  .phone-text-input {
    padding: 8px 6px;
  }

  .otp-box {
    width: 40px;
    height: 46px;
    font-size: 19px;
    border-radius: 10px;
  }

  .otp-row {
    gap: 6px;
  }

  /* Stack modal buttons on extra narrow screens for comfortable tapping */
  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .btn-modal-cancel,
  .modal-action-form {
    width: 100%;
    flex: none;
  }
}

/* Landscape Mode on Small Screens & Mobile (height <= 640px) */
@media (max-height: 640px) and (orientation: landscape) {
  body {
    padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .card {
    padding: 16px 24px 14px;
    border-radius: 18px;
  }

  .brand-header {
    margin-bottom: 10px;
  }

  .brand-logo-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    margin-bottom: 6px;
    padding: 4px;
  }

  h1 {
    font-size: 19px;
    margin-bottom: 2px;
  }

  .subtitle {
    font-size: 12px;
  }

  .user-profile-box {
    padding: 10px 14px;
    margin-bottom: 10px;
    gap: 4px;
  }

  .user-avatar-circle {
    width: 42px;
    height: 42px;
    margin-bottom: 2px;
  }

  .user-avatar-circle span {
    font-size: 18px;
  }

  .profile-name {
    font-size: 16px;
  }

  .profile-phone {
    font-size: 12px;
  }

  .verified-pill {
    padding: 2px 8px;
    font-size: 10px;
    margin-top: 2px;
  }

  .profile-actions-group {
    margin-top: 8px;
    gap: 8px;
  }

  .btn-primary {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
  }

  .btn-delete-trigger {
    padding: 9px 14px;
    font-size: 12.5px;
    border-radius: 10px;
  }

  .card-footer-note {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 11px;
  }

  .modal-card {
    padding: 18px 20px 16px;
    max-height: calc(100dvh - 20px);
  }

  .modal-icon-badge {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
  }

  .modal-icon-badge svg {
    width: 20px;
    height: 20px;
  }

  .modal-title {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .modal-text {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .btn-modal-cancel,
  .btn-modal-logout-confirm,
  .btn-modal-confirm {
    padding: 9px 12px;
    font-size: 12.5px;
    border-radius: 8px;
  }
}


