:root {
  --brand: #FF9500;
  --brand-700: #E68900;
  --brand-100: #FFF8F0;
  --bg: #ffffff;
  --gray-900: #1d1d1f;
  --gray-600: #86868b;
  --gray-100: #f5f5f7;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

body {
  margin: 0; 
  min-height: 100vh; 
  overflow: auto;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex; 
  flex-direction: column;
  justify-content: center; 
  align-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 50%, #FFB84D 100%);
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
  position: relative;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#particles { position: fixed; inset:0; z-index:0; }

.card {
  position: relative; 
  z-index:1;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 48px 56px;
  width: 520px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: slideIn 0.6s var(--ease) forwards;
  opacity:0;
  overflow: visible;
}

@keyframes slideIn {
  from { opacity:0; transform:translateY(30px); }
  to { opacity:1; transform:translateY(0); }
}
.card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.card form.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.card form input,
.card form .drop-down-menu {
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.card form .btn {
    grid-column: 1 / -1;
    margin-top: 16px;
}

.card h2 {
  text-align: center;
  margin-bottom: 40px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

input,
select,
textarea {
  padding: 16px 20px; 
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gray-900);
  font-size: 17px;
  outline: none;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  width: 100%;
  -webkit-appearance: none;
  position: relative;
  z-index: 2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

input::placeholder {
  color: rgba(29, 29, 31, 0.6);
}

.btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 17px;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.4);
  -webkit-appearance: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  background: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 149, 0, 0.5);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
}

.msg {
  text-align:center; margin-bottom:16px;
  animation: fadeShake 0.6s;
}

@keyframes fadeShake {
  0% { opacity:1; transform:translateX(-10px); }
  50% { opacity:1; transform:translateX(10px); }
  100% { opacity:1; transform:translateX(0); }
}

.link {
  text-align: center;
  display: block;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.erdos-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(60px, 15vw, 100px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  letter-spacing: 6px;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
  width: calc(100% - 40px);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  body {
    padding: 20px 20px 80px;
  }
  
  .card { 
    padding: 40px 32px; 
    width: 100%;
    max-width: 100%;
  }
  
  .card h2 {
    font-size: 28px;
    margin-bottom: 32px;
  }
  
  .card form {
    grid-template-columns: 1fr;
  }
  
  .phone-input-wrapper {
    flex-direction: column;
    grid-column: span 1;
  }
  
  .country-code-selector {
    min-width: 100%;
  }
  
  input,
  select,
  .drop-down-menu { 
    padding: 14px 18px; 
    margin-bottom: 20px; 
    font-size: 16px;
    min-height: 44px;
  }
  
  .btn { 
    padding: 14px 20px; 
    font-size: 17px; 
    min-height: 44px; 
  }
  
  .erdos-watermark { 
    font-size: clamp(50px, 20vw, 80px);
    letter-spacing: 4px;
    width: calc(100% - 32px);
  }
  
  .auth-footer {
    padding: 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 16px 70px;
  }
  
  .card { 
    padding: 32px 24px; 
  }
  
  .card h2 {
    font-size: 24px;
    margin-bottom: 28px;
  }
  
  input,
  select,
  .drop-down-menu { 
    padding: 12px 16px; 
    margin-bottom: 18px; 
    font-size: 16px; 
    min-height: 44px; 
  }
  
  .btn { 
    padding: 12px 18px; 
    font-size: 17px; 
    min-height: 44px; 
  }
  
  .auth-footer {
    padding: 12px;
    font-size: 12px;
  }
}
.drop-down-menu {
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gray-900);
  font-size: 17px;
  outline: none;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231d1d1f'><polygon points='0,0 16,0 8,8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  z-index: 2;
}

.drop-down-menu:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.drop-down-menu option {
  background: rgba(255, 255, 255, 0.95);
  color: var(--gray-900);                   
  padding: 12px;                 
  font-size: 17px;
}

/* Password wrapper styling */
.password-wrapper {
  position: relative;
  margin-bottom: 20px;
  z-index: 2;
}

.password-wrapper input {
  margin-bottom: 0;
  padding-right: 50px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(29, 29, 31, 0.6);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: all 0.3s var(--ease);
}

.toggle-password:hover {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.3);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

.toggle-password i {
  font-size: 18px;
}

/* Phone input wrapper */
.phone-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 0;
  grid-column: span 2;
  position: relative;
  z-index: 2;
}

.phone-input-wrapper input[type="tel"] {
  margin-bottom: 0;
}

.country-code-selector {
  position: relative;
  min-width: 180px;
  flex-shrink: 0;
  margin-bottom: 0;
  z-index: 10;
}

.country-code-selector input[type="text"] {
  margin-bottom: 0;
}

#country_code_dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-top: 0;
}

#country_code_dropdown div {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s var(--ease);
}

#country_code_dropdown div:hover {
  background: rgba(255, 149, 0, 0.15);
}

#country_code_dropdown div:last-child {
  border-bottom: none;
}

#country_code_dropdown div span:first-child {
  font-size: 1.2em;
}

#country_code_dropdown div span:nth-child(2) {
  font-weight: 600;
  min-width: 60px;
}

#country_code_dropdown div span:nth-child(3) {
  color: var(--gray-600);
  font-size: 0.9em;
}

.phone-input-wrapper input[type="tel"] {
  flex: 1;
  margin-bottom: 0;
}

/* Footer */
.auth-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s var(--ease);
}

.auth-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Message styling */
.msg {
  text-align: center;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  animation: fadeShake 0.6s;
  position: relative;
  z-index: 2;
}