/* ============================================
   ISTech - Auth Pages (auth.css)
   Shared by login.html and signup.html
   ============================================ */

/* ---------- Auth Body ---------- */
.auth-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Auth Nav ---------- */
.auth-nav {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.auth-nav-hint {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-nav-hint a {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--transition);
}
.auth-nav-hint a:hover { opacity: 0.8; }

/* ---------- Auth Main ---------- */
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 64px);
}

/* ---------- Visual Panel (left) ---------- */
.auth-panel-visual {
  background: linear-gradient(145deg, var(--primary) 0%, #0d3a6e 60%, #0a2540 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}

.auth-panel-signup {
  background: linear-gradient(145deg, #06473a 0%, #006b5f 50%, var(--primary) 100%);
}

.apv-bg-shape {
  position: absolute;
  bottom: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,194,168,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.apv-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

/* Testimonial */
.apv-quote {
  margin-bottom: 48px;
}

.apv-stars {
  color: #ffd700;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.apv-quote blockquote {
  font-size: 19px;
  font-style: italic;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 24px;
  quotes: none;
}

.apv-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.apv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.apv-author strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.apv-author span {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* Stats */
.apv-stats {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.apv-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.apv-stat span {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.apv-stat small {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Signup panel extras */
.apv-benefits h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.apv-benefits p {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 28px;
  font-weight: 300;
  line-height: 1.65;
}

.apv-benefit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.apv-benefit-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

.apv-check {
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.apv-course-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acp-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: background var(--transition);
}
.acp-card:hover { background: rgba(255,255,255,0.12); }

.acp-card span { font-size: 24px; }

.acp-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.acp-card small {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* ---------- Form Panel (right) ---------- */
.auth-panel-form {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}

.auth-form-inner {
  width: 100%;
  max-width: 440px;
  padding-bottom: 150px;
}

.auth-form-header {
  margin-bottom: 32px;
}

.auth-form-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.auth-form-header p {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 300;
}

/* Social Auth */
.social-auth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.social-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.social-auth-btn:hover {
  border-color: var(--primary);
  background: var(--surface-alt);
  transform: translateY(-1px);
}

.social-auth-btn:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.social-auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 37, 64, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: socialSpin 0.8s linear infinite;
}

@keyframes socialSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form elements */
.auth-form { display: flex; flex-direction: column; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--transition);
}
.forgot-link:hover { opacity: 0.8; }

.req { color: var(--accent-warm); }

.form-group input,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7A99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,194,168,0.12);
}

.form-group input.error,
.form-group select.error {
  border-color: #e53935;
}

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

.field-error {
  font-size: 12px;
  color: #e53935;
  font-weight: 500;
  min-height: 16px;
}

/* Password field */
.password-field {
  position: relative;
}

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

.pw-toggle {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  color: var(--text-muted);
}

/* Password strength */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.pw-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.pw-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-strength span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}

/* Checkbox */
.form-checkbox { margin-bottom: 24px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

/* Submit */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 15px;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  gap: 0;
}

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  transition: all var(--transition);
  flex-shrink: 0;
  position: relative;
}

.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.step-dot.active::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.step-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.form-step { display: flex; flex-direction: column; }
.form-step.hidden { display: none !important; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.step-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.step-actions .btn-outline {
  flex: 0 0 auto;
}

.step-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

/* Switch link */
.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--transition);
}
.auth-switch a:hover { opacity: 0.8; }

/* Hidden utility */
.hidden { display: none !important; }

/* Auth success */
.auth-success {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 0;
  gap: 14px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 37, 64, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.auth-success .success-icon {
  font-size: 56px;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.auth-success h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.auth-success p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.7;
  font-weight: 300;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-panel-visual { display: none; }
  .auth-panel-form { padding: 40px 24px; }
}

@media (max-width: 480px) {
  .auth-nav { padding: 0 16px; }
  .auth-nav-hint { display: none; }
  .form-row-2 { grid-template-columns: 1fr; }
}
