/* application.studily.org — public team application form.
 * Same Studily white/black modern language as the TG portal. */

:root {
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --card-sub: #FAFAFA;
  --border: #E5E5E5;
  --ink: #0A0A0A;
  --ink-secondary: #404040;
  --muted: #737373;
  --subtle: #F5F5F5;
  --danger: #DC2626;
  --ok: #15803D;
  --radius: 16px;
  --radius-full: 9999px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

#app { max-width: 640px; margin: 0 auto; padding: 14px 16px 80px; }

.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; gap: 12px;
  color: var(--muted); font-size: 14px; font-weight: 500;
}

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; position: sticky; top: 10px; z-index: 20;
  background: #FFF; border: 1px solid var(--border);
  border-radius: var(--radius-full); box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.topbar img.mark { width: 24px; height: 24px; border-radius: 6px; }
.topbar h1 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.2px; flex: 1; }

.hero { text-align: center; padding: 26px 14px 20px; }
.hero img { width: 120px; margin-bottom: 10px; }
.hero h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 14px; max-width: 460px; margin: 0 auto; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); margin-bottom: 6px;
}
.field label .req { color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  background: #FFF; color: var(--ink); outline: none;
  transition: border-color 0.12s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #000; }
.field textarea { resize: vertical; min-height: 110px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.row { display: flex; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
@media (max-width: 520px) { .row { flex-direction: column; gap: 0; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 12px 22px; font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; background: #FFF; color: var(--ink);
  transition: all 0.12s ease; text-decoration: none;
}
.btn.primary { background: #0A0A0A; color: #FFF; border-color: #0A0A0A; }
.btn.primary:active { transform: scale(0.98); }
.btn.ghost:hover { background: var(--subtle); }
.btn.sm { padding: 8px 16px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 700;
  background: var(--subtle); border: 1px solid var(--border); color: var(--ink-secondary);
}

.photo-drop {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; cursor: pointer;
  background: var(--card-sub); transition: all 0.12s ease;
}
.photo-drop:hover { border-color: #0A0A0A; }
.photo-drop img.preview {
  width: 110px; height: 110px; object-fit: cover;
  border-radius: 50%; border: 3px solid #FFF;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15); margin-bottom: 10px;
}
.photo-drop .p-title { font-weight: 700; font-size: 14px; }
.photo-drop .p-sub { color: var(--muted); font-size: 12.5px; }

.step-card { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.step-card:last-child { border-bottom: 0; }
.step-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #0A0A0A; color: #FFF; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.step-title { font-weight: 700; font-size: 13.5px; }
.step-desc { color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0A0A0A; border: 1px solid #262626; color: #FFF;
  padding: 10px 20px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); white-space: nowrap;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}

.err { color: var(--danger); font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.center { text-align: center; }
.big-check {
  width: 64px; height: 64px; border-radius: 50%; margin: 8px auto 14px;
  background: #0A0A0A; color: #FFF; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.app-id {
  font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px; display: inline-block; margin: 8px 0;
}

/* Login */
.login-wrap { max-width: 400px; margin: 8vh auto 0; }
.login-logo { width: 130px; display: block; margin: 0 auto 14px; }

/* Animated Noto emoji inline */
img.emj { vertical-align: -3px; }

/* Track picker cards */
.track-card {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px; background: #FFF;
  cursor: pointer; transition: all 0.14s ease; box-shadow: var(--shadow);
}
.track-card:hover { border-color: #0A0A0A; transform: translateY(-1px); }
.track-emoji { width: 44px; text-align: center; flex: none; }
.track-title { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; }
.track-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.chev { color: var(--muted); font-size: 20px; font-weight: 700; flex: none; }
.grow { flex: 1; min-width: 0; }

/* Application status rows */
.status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: 0; }
.status-row .t { font-weight: 700; font-size: 13.5px; }
.status-row .s { color: var(--muted); font-size: 12px; margin-top: 1px; }
.pill.pending { background: #FFFBEB; color: #B45309; border-color: rgba(180,83,9,0.25); }
.pill.approved { background: #F0FDF4; color: #15803D; border-color: rgba(21,128,61,0.25); }
.pill.rejected { background: #FEF2F2; color: #DC2626; border-color: rgba(220,38,38,0.25); }

/* Dial-code select column */
.dial { width: 148px; flex: none; }
@media (max-width: 520px) { .dial { width: 100%; } }
.dial select { font-size: 13px; }
