/* ===== Modal Overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Modal Card ===== */
.modal-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 420px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Modal Tabs ===== */
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--color-border);
}

.modal-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}

.modal-tab:hover {
  color: var(--color-text);
}

.modal-tab.active {
  color: var(--color-accent);
  font-weight: 500;
  border-bottom-color: var(--color-accent);
}

/* ===== Tab Content ===== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 16px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* ===== Password Group with Eye Toggle ===== */
.password-group {
  position: relative;
}

.password-group .form-input {
  padding-right: 48px;
}

.eye-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  color: var(--color-text-light);
  transition: color var(--transition);
}

.eye-toggle:hover {
  color: var(--color-text);
}

/* ===== Code Group ===== */
.code-group {
  position: relative;
}

.code-group .form-input {
  padding-right: 120px;
}

.btn-send-code {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-accent);
  color: var(--color-white);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-send-code:hover {
  background: var(--color-accent-hover);
}

.btn-send-code:disabled {
  background: var(--color-text-muted);
  cursor: not-allowed;
}

/* ===== Form Hints ===== */
.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 20px;
}

.code-hint {
  text-align: right;
  margin-top: -8px;
}

/* ===== Confirm Button ===== */
.btn-confirm {
  display: block;
  width: 160px;
  margin: 24px auto 0;
  padding: 12px 24px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--transition), transform var(--transition);
}

.btn-confirm:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

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

/* ===== Form Message ===== */
.form-message {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.form-message.success {
  color: var(--color-success);
  background: rgba(39, 174, 96, 0.08);
}

.form-message.error {
  color: var(--color-error);
  background: rgba(231, 76, 60, 0.08);
}
