/* ========== Auth Pages Shared Styles ========== */
:root {
  --un-blue: #009edb;
  --un-blue-dark: #0077a8;
  --un-blue-light: #e8f6fc;
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --bg-light: #f7f9fc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --accent-red: #e74c3c;
  --accent-orange: #f39c12;
  --accent-green: #27ae60;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====== Top Bar ====== */
.auth-header {
  background: linear-gradient(135deg, #1a2332 0%, #0d3c6e 100%);
  padding: 16px 0;
  text-align: center;
}
.auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
}
.auth-header .logo-un-icon {
  width: 36px; height: 36px;
}
.auth-header .auth-platform-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.auth-back-home {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  text-decoration: none;
  margin-left: 16px;
  transition: color 0.2s;
}
.auth-back-home:hover { color: #fff; }

/* ====== Main Container ====== */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.auth-card-wide {
  max-width: 680px;
}

.auth-card-header {
  padding: 32px 36px 0;
  text-align: center;
}
.auth-card-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.auth-card-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ====== Steps Indicator ====== */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 36px 0;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s;
}
.step-dot.active {
  background: var(--un-blue);
  color: #fff;
}
.step-dot.done {
  background: var(--accent-green);
  color: #fff;
}
.step-line {
  width: 60px; height: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.step-line.done {
  background: var(--accent-green);
}
.step-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 36px 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.step-label-row span {
  width: 32px; text-align: center;
  margin: 0 30px;
}
.step-label-row span:first-child { margin-left: 0; }
.step-label-row span:last-child { margin-right: 0; }

/* ====== Form Body ====== */
.auth-form {
  padding: 0 36px 28px;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--un-blue);
  box-shadow: 0 0 0 3px rgba(0,158,219,0.1);
}
.form-input.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}
.form-input.success {
  border-color: var(--accent-green);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error {
  font-size: 11px;
  color: var(--accent-red);
  margin-top: 4px;
  display: none;
}
.form-error.show { display: block; }

/* ====== Row Layouts ====== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ====== Captcha ====== */
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.captcha-row .form-input {
  flex: 1;
}
.captcha-img {
  width: 110px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  background: #f0f4f8;
}

/* SMS code button */
.sms-btn {
  width: 120px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--un-blue);
  background: #fff;
  color: var(--un-blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  white-space: nowrap;
}
.sms-btn:hover { background: var(--un-blue-light); }
.sms-btn:disabled {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ====== Checkbox ====== */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox-group input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--un-blue);
}
.checkbox-group a {
  color: var(--un-blue);
  text-decoration: none;
}
.checkbox-group a:hover { text-decoration: underline; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--un-blue);
  color: #fff;
  border-color: var(--un-blue);
}
.btn-primary:hover {
  background: var(--un-blue-dark);
  border-color: var(--un-blue-dark);
  box-shadow: var(--shadow-md);
}
.btn-primary:disabled {
  background: #a0d4ed;
  border-color: #a0d4ed;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-outline {
  background: transparent;
  color: var(--un-blue);
  border-color: var(--un-blue);
}
.btn-outline:hover {
  background: var(--un-blue-light);
}
.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 12px;
}
.btn-block {
  display: flex;
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.form-actions .btn { flex: 1; }

/* ====== Links ====== */
.auth-links {
  text-align: center;
  padding: 0 36px 28px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-links a {
  color: var(--un-blue);
  text-decoration: none;
  font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }

/* ====== Success Step ====== */
.auth-success {
  text-align: center;
  padding: 20px 36px 28px;
}
.auth-success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #e8f8ef;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.auth-success h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.auth-success p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.auth-success .success-info {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
  text-align: left;
  font-size: 13px;
  line-height: 1.8;
}
.auth-success .success-info span {
  color: var(--text-muted);
}

/* ====== File Upload ====== */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.file-upload:hover {
  border-color: var(--un-blue);
  background: var(--un-blue-light);
}
.file-upload.has-file {
  border-color: var(--accent-green);
  background: #e8f8ef;
}
.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload .upload-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.file-upload .upload-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.file-upload .upload-name {
  font-size: 12px;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 4px;
}

/* ====== Select ====== */
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-select:focus {
  border-color: var(--un-blue);
  box-shadow: 0 0 0 3px rgba(0,158,219,0.1);
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .auth-card { max-width: 100%; }
  .auth-card-header { padding: 24px 20px 0; }
  .auth-form { padding: 0 20px 20px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
  .auth-links { padding: 0 20px 20px; }
  .auth-success { padding: 16px 20px 20px; }
}
