/* ============================================
   FastDrop — Login Page (iOS Native)
   With Icons • FastDrop Brand • Dense Layout
   ============================================ */

/* --- 1. Font Import (Inter Only) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:slnt,wght@-10..0,100..900&display=swap');

/* --- 2. Design Tokens — FastDrop Brand --- */
:root {
  /* Brand Identity */
  --primary: #FF6B35;
  --primary-light: #FF8C5F;
  --secondary: #1A936F;
  --accent: #114B5F;
  --dark: #1C1C1E;

  /* iOS System Surfaces */
  --system-bg: #F2F2F7;
  --system-white: #FFFFFF;
  --system-grouped: #F9F9F9;
  --system-separator: rgba(60, 60, 67, 0.12);
  --system-fill: rgba(120, 120, 128, 0.08);
  --system-fill-secondary: rgba(120, 120, 128, 0.12);

  /* Typography Colors */
  --label-primary: #1C1C1E;
  --label-secondary: #636366;
  --label-tertiary: #AEAEB2;
  --label-quaternary: #D1D1D6;

  /* Semantic */
  --system-green: #34C759;
  --system-red: #FF3B30;
  --system-blue: #007AFF;

  /* Elevation (Soft Layered) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06);

  /* Radius (Squircle — Continuous Corners) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing Grid (4px Base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Typography */
  --font-system: 'Inter', -apple-system, sans-serif;
  --letter-spacing-tight: -0.022em;
  --letter-spacing-normal: -0.01em;
  --line-height-compact: 1.2;
  --line-height-readable: 1.45;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- 3. Global Reset — Inter ONLY on text, NEVER on ::before/::after --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
input,
textarea,
button,
select,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
div,
li,
td,
th,
label,
.form-title,
.form-description {
  font-family: var(--font-system);
}

body {
  background-color: var(--system-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: var(--space-4);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-readable);
}

::-webkit-scrollbar {
  display: none;
}

html,
body {
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

/* --- 4. Container (Squircle Card) --- */
.container.ios-style {
  width: 92%;
  max-width: 380px;
  padding: var(--space-6) var(--space-5);
  background: var(--system-white);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.03),
    0 6px 20px rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  /* 28px */
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

/* --- 5. Brand Section --- */
.brand-section {
  text-align: center;
  margin-bottom: var(--space-6);
}

.brand-logo img {
  width: 72px;
  height: auto;
  margin-bottom: var(--space-3);
}

.form-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--label-primary);
  margin: 0 0 var(--space-1);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-compact);
}

.form-description {
  font-size: 0.78rem;
  color: var(--label-tertiary);
  font-weight: 500;
}

/* --- 6. Alert Message --- */
.message {
  padding: var(--space-3);
  background: rgba(255, 59, 48, 0.06);
  border-radius: var(--radius-sm);
  color: var(--system-red);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: var(--space-4);
  border: 0.5px solid rgba(255, 59, 48, 0.1);
}

/* --- 7. Input Group Stack (iOS Style) --- */
.ios-input-group {
  background: var(--system-fill);
  border-radius: var(--radius-sm);
  /* 10px */
  overflow: hidden;
  margin-bottom: var(--space-5);
  border: 0.5px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ios-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

/* --- 8. Form Group (with Icons) --- */
.form-group {
  position: relative;
  border-bottom: 0.5px solid var(--system-separator);
}

.form-group:last-child {
  border-bottom: none;
}

/* Verification group separator */
.verification-group {
  border-top: 0.5px solid var(--system-separator);
}

/* Input Icon (Left) */
.input-icon {
  position: absolute;
  left: var(--space-4);
  /* 16px */
  top: 50%;
  transform: translateY(-50%);
  color: var(--label-tertiary);
  font-size: 0.95rem;
  z-index: 1;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-group:focus-within .input-icon {
  color: var(--primary);
}

/* Verification Icon (Right) */
.verification-icon {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-size: 0.85rem;
  opacity: 0.6;
  z-index: 2;
  pointer-events: none;
}

/* Input Field */
.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  /* 12px 16px 12px 40px */
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  color: var(--label-primary);
  letter-spacing: var(--letter-spacing-normal);
  height: 48px;
  text-align: start;
}

.form-input::placeholder {
  color: var(--label-quaternary);
  font-weight: 400;
}

/* RTL */
[dir="rtl"] .form-input {
  padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4);
  text-align: right;
}

[dir="rtl"] .input-icon {
  left: auto;
  right: var(--space-4);
}

[dir="rtl"] .verification-icon {
  right: auto;
  left: var(--space-4);
}

/* --- 9. Password Group --- */
.password-group {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-password {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--label-tertiary);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

[dir="rtl"] .toggle-password {
  right: auto;
  left: var(--space-3);
}

.toggle-password:active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--label-primary);
}

/* --- 10. Options Row --- */
.options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  padding: 0 var(--space-1);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--label-secondary);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Forgot Password Link */
.form-link {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
}

.form-link:active {
  opacity: 0.7;
}

/* --- 11. Form Footer (Forgot Password) --- */
.form-footer {
  text-align: right;
  margin-bottom: var(--space-5);
}

.ios-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.ios-link i {
  font-size: 0.7rem;
}

.ios-link:active {
  opacity: 0.7;
}

/* --- 12. Submit Button --- */
.submit-btn.ios-btn {
  width: 100%;
  padding: var(--space-3);
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  /* 14px */
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: var(--letter-spacing-normal);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.22);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.submit-btn.ios-btn:active {
  transform: scale(0.97);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.submit-btn i {
  font-size: 0.85rem;
}

/* --- 13. Footer Link (Login instead of Signup) --- */
.footer-link {
  text-align: center;
  margin-top: var(--space-5);
}

.footer-link a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
}

.footer-link a:active {
  opacity: 0.7;
}

/* --- 14. Divider (Or) --- */
.divider {
  text-align: center;
  position: relative;
  margin: var(--space-5) 0;
}

/* 🔴 CRITICAL: ::before/::after for decorative line ONLY — do NOT set font-family */
.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 28px);
  height: 0.5px;
  background: var(--system-separator);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider span {
  background: var(--system-white);
  padding: 0 var(--space-4);
  color: var(--label-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
  position: relative;
  z-index: 1;
}

/* --- 15. Create Account Box --- */
.signup-section {
  margin-top: var(--space-6);
}

.create-account-box {
  background: var(--system-fill);
  border-radius: var(--radius-sm);
  /* 10px */
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: 0.5px solid transparent;
  text-decoration: none;
}

.create-account-box:active {
  background: var(--system-fill-secondary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.06);
}

/* Icon */
.create-icon {
  font-size: 1.8rem;
  color: var(--primary);
  background: var(--system-white);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  /* 14px */
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}

/* Text Content */
.create-account-text {
  flex: 1;
}

.no-account-text {
  font-size: 0.72rem;
  color: var(--label-secondary);
  margin: 0 0 var(--space-1);
  font-weight: 500;
}

.create-account-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: var(--letter-spacing-normal);
}

.create-account-btn i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

/* --- 16. Responsive --- */
@media (max-width: 380px) {
  .container.ios-style {
    width: 96%;
    padding: var(--space-5) var(--space-4);
  }

  .form-title {
    font-size: 1.2rem;
  }

  .form-input {
    height: 44px;
    font-size: 0.85rem;
  }

  .submit-btn.ios-btn {
    height: 44px;
    font-size: 0.9rem;
  }

  .brand-logo img {
    width: 60px;
  }

  .create-icon {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    padding: var(--space-2);
  }
}

@media (min-width: 768px) {
  .container.ios-style {
    max-width: 400px;
    padding: var(--space-8);
  }
}