/* ==========================================================================
   ISMS CRM - Employee Sign Up Styles
   Modern, responsive, glassmorphic design matching brand palette & dark mode
   ========================================================================== */

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, #15243b 0%, #103DA8 50%, #1d4ed8 100%);
  padding: 30px 16px;
  position: relative;
  overflow-x: hidden;
  color: #202C40;
}

/* Background animated decorative blobs */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
}

body::before {
  width: 380px;
  height: 380px;
  background: #C99A35;
  top: -80px;
  left: -80px;
}

body::after {
  width: 440px;
  height: 440px;
  background: #38bdf8;
  bottom: -100px;
  right: -100px;
}

/* Top corner theme button */
.login-theme-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Card Container */
.emp-signup-card {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 40px 38px 36px;
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 24px 64px rgba(10, 25, 68, 0.35), 0 4px 20px rgba(0, 0, 0, 0.08);
  border-top: 5px solid #2857B8;
  position: relative;
  z-index: 1;
  animation: fadeInCard 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header & Badges */
.card-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EBF2FE;
  color: #103DA8;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.card-header-badge svg {
  width: 14px;
  height: 14px;
}

.logo-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #E8EEFB;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(16, 61, 168, 0.12);
}

.logo-wrap svg {
  width: 36px;
  height: 36px;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1a2538;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
  text-align: center;
}

.subtitle {
  font-size: 0.92rem;
  color: #64748b;
  margin-bottom: 24px;
  text-align: center;
}

/* Role / Account Switcher Tabs */
.role-tabs {
  display: flex;
  width: 100%;
  background: #F1F5F9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.role-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.role-tab.active {
  background: #FFFFFF;
  color: #103DA8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.role-tab:hover:not(.active) {
  color: #1e293b;
}

/* Form Layout */
.form-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 4px;
}

.form-grid.full-width {
  grid-template-columns: 1fr;
}

.input-group {
  width: 100%;
  margin-bottom: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-label span.req {
  color: #e11d48;
  margin-left: 2px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper .icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.input-wrapper input::placeholder {
  color: #94a3b8;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: #103DA8;
  box-shadow: 0 0 0 3.5px rgba(16, 61, 168, 0.12);
  background: #ffffff;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  background: none;
  border: none;
  display: flex;
  padding: 4px;
  transition: color 0.15s;
}

.toggle-pw:hover {
  color: #103DA8;
}

/* Password strength & match indicators */
.pw-strength-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
  position: relative;
}

.pw-strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  background: #ef4444;
}

.pw-hint {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 4px;
}

/* Terms Checkbox */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 4px 0 18px;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.4;
  cursor: pointer;
}

.terms-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #103DA8;
  margin-top: 2px;
  cursor: pointer;
}

.terms-row a {
  color: #103DA8;
  text-decoration: none;
  font-weight: 600;
}

.terms-row a:hover {
  text-decoration: underline;
}

/* Sign Up Button */
.btn-signup {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #103DA8 0%, #2857B8 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(16, 61, 168, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
  margin-bottom: 20px;
}

.btn-signup:hover {
  background: linear-gradient(135deg, #0d328c 0%, #1e459c 100%);
  box-shadow: 0 6px 20px rgba(16, 61, 168, 0.4);
  transform: translateY(-1px);
}

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

.btn-signup:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Footer / Switch rows */
.footer-row {
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.footer-row a {
  color: #103DA8;
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.footer-row a:hover {
  text-decoration: underline;
}

.admin-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 14px;
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.admin-link-badge a {
  color: #C99A35;
  font-weight: 700;
  text-decoration: none;
}

.admin-link-badge a:hover {
  text-decoration: underline;
}

/* Feedback Messages */
.signup-error {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.signup-success {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   DARK THEME COMPATIBILITY
   ========================================================================== */
[data-theme="dark"] body {
  background: radial-gradient(circle at 10% 20%, #0b111e 0%, #0f172a 50%, #1e293b 100%);
  color: #e2e8f0;
}

[data-theme="dark"] .emp-signup-card {
  background: #1e293b;
  border-top-color: #38bdf8;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] h1 {
  color: #f8fafc;
}

[data-theme="dark"] .subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .card-header-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

[data-theme="dark"] .logo-wrap {
  background: #0f172a;
}

[data-theme="dark"] .role-tabs {
  background: #0f172a;
}

[data-theme="dark"] .role-tab.active {
  background: #334155;
  color: #38bdf8;
}

[data-theme="dark"] .role-tab:hover:not(.active) {
  color: #cbd5e1;
}

[data-theme="dark"] .input-label {
  color: #cbd5e1;
}

[data-theme="dark"] .input-wrapper input,
[data-theme="dark"] .input-wrapper select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .input-wrapper input:focus,
[data-theme="dark"] .input-wrapper select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.18);
  background: #131d31;
}

[data-theme="dark"] .terms-row {
  color: #94a3b8;
}

[data-theme="dark"] .terms-row a {
  color: #38bdf8;
}

[data-theme="dark"] .admin-link-badge {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .btn-signup {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .footer-row {
  color: #94a3b8;
}

[data-theme="dark"] .footer-row a {
  color: #38bdf8;
}

/* Responsive design */
@media (max-width: 620px) {
  .emp-signup-card {
    padding: 30px 20px 24px;
    border-radius: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  h1 {
    font-size: 1.45rem;
  }
}
