/* ============================================================
   T-Tech Connect — Login Page Styles
   ============================================================ */

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

:root {
  --primary:       #075e54;
  --primary-dark:  #064e44;
  --primary-light: #10b981;
  --primary-glow:  rgba(16,185,129, 0.25);
  --error:         #dc2626;
  --error-bg:      #fef2f2;
  --error-border:  #fca5a5;
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --success-border:#86efac;
  --info-bg:       #f0fdf4;
  --info-border:   #6ee7b7;
  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;
  --border:        #e5e7eb;
  --border-focus:  #10b981;
  --bg-input:      #f9fafb;
  --white:         #ffffff;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.12);
  --transition:    all .2s ease;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f0fdf4;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Background decorations ─────────────────────────────── */
.bg-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
}
.circle-1 { width: 600px; height: 600px; background: #bbf7d0; top: -200px; left: -200px; }
.circle-2 { width: 400px; height: 400px; background: #99f6e4; bottom: -150px; right: -100px; }
.circle-3 { width: 300px; height: 300px; background: #fde68a; top: 40%; left: 45%; }

/* ── Layout ─────────────────────────────────────────────── */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}
.login-container--centered {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

/* ── Brand panel ─────────────────────────────────────────── */
.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 45%;
  min-height: 100vh;
  background: linear-gradient(145deg, #064e46 0%, #075e54 45%, #0d9488 100%);
  padding: 3rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.brand-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.brand-content { position: relative; z-index: 1; }

.logo-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 3rem;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.brand-headline {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.5px;
}
.brand-sub {
  font-size: .95rem;
  line-height: 1.6;
  opacity: .8;
  margin-bottom: 2.5rem;
  max-width: 340px;
}

.feature-list { display: flex; flex-direction: column; gap: 1rem; }
.feature-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  opacity: .9;
}
.feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-footer {
  font-size: .8rem;
  opacity: .5;
  position: relative;
  z-index: 1;
}

/* ── Form panel ──────────────────────────────────────────── */
.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--white);
}
.form-container {
  width: 100%;
  max-width: 460px;
}

.form-header { margin-bottom: 2rem; text-align: center; }
.form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.5px;
  margin-bottom: .5rem;
}
.form-sub { font-size: .9rem; color: var(--text-secondary); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--error-bg);   border: 1px solid var(--error-border);   color: var(--error);   }
.alert-info    { background: var(--info-bg);    border: 1px solid var(--info-border);    color: #075e54; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }

/* ── Fields ──────────────────────────────────────────────── */
.field-group { margin-bottom: 1.25rem; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: .45rem;
}
.forgot-link {
  font-size: .82rem;
  font-weight: 400;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
.forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }

.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}
.field-input {
  width: 100%;
  padding: .8rem 3rem .8rem 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.field-input::placeholder { color: var(--text-muted); }
.field-input:focus {
  border-color: var(--border-focus);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.field-input.is-invalid { border-color: var(--error); }
.field-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.toggle-pwd {
  position: absolute;
  right: .9rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  padding: .25rem;
  border-radius: 4px;
  transition: color .2s;
}
.toggle-pwd:hover { color: var(--text-primary); }

.field-error {
  display: block;
  font-size: .8rem;
  color: var(--error);
  margin-top: .3rem;
  min-height: 1em;
}

/* ── Strength bar ────────────────────────────────────────── */
.strength-wrap {
  margin-top: -.75rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .3s ease, background .3s ease;
  width: 0;
}
.strength-label { font-size: .75rem; color: var(--text-secondary); white-space: nowrap; }

/* ── Remember me ─────────────────────────────────────────── */
.remember-row { margin-bottom: 1.5rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-input { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.checkbox-input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}
.checkbox-text { font-size: .875rem; color: var(--text-secondary); }

/* ── Submit button ───────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: .9rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  box-shadow: 0 4px 14px rgba(7,94,84,.4);
  position: relative;
  overflow: hidden;
}
.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.btn-submit:hover::after { background: rgba(255,255,255,.07); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner-svg { animation: spin .8s linear infinite; }

/* ── Auth tabs ───────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.75rem;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: .6rem 1rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
}
.auth-tab.active {
  background: var(--white);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.auth-tab:not(.active):hover { color: var(--text-primary); }

/* ── Role selection cards ────────────────────────────────── */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-top: .2rem;
}
.role-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  background: var(--bg-input);
  position: relative;
  user-select: none;
}
.role-radio { display: none; }
.role-card:hover { border-color: var(--primary-light); background: #f0fdf4; }
.role-card:has(.role-radio:checked) {
  border-color: var(--primary);
  background: #f0fdf4;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.role-card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #d1fae5;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.role-card:has(.role-radio:checked) .role-card-icon {
  background: var(--primary);
  color: #fff;
}
.role-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.role-card-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
}
.role-card-sub {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.role-card-check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all .2s;
}
.role-card:has(.role-radio:checked) .role-card-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}


/* ── Auth divider ────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .9rem 0;
  color: var(--text-muted);
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Optional field label ────────────────────────────────── */
.field-optional {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: .2rem;
}

/* ── Switch hint ─────────────────────────────────────────── */
.switch-hint {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .875rem;
  color: var(--text-secondary);
}
.switch-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: none;
}
.switch-link:hover { text-decoration: underline; }

/* ── Forgot password page ────────────────────────────────── */
.back-link-wrap { margin-bottom: 1.5rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .2s;
}
.back-link:hover { color: var(--primary); }
.icon-wrap-large {
  width: 64px; height: 64px;
  background: #f0fdf4;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin: 0 auto 1.25rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 1.5rem; }
  .form-container { max-width: 100%; }
  .form-title { font-size: 1.5rem; }
  .brand-headline { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .form-panel { padding: 1.25rem; }
}
