/* ==========================================================================
   CYNOVATE TECHNOLOGIES PRIVATE LIMITED
   EMPLOYEE LOGIN PORTAL — ISOLATED STYLESHEET
   Brand Colors:
     Navy: #0A2A5E
     Blue: #1A7CFF
     Cyan: #00CFFF
     White: #FFFFFF
   ========================================================================== */

:root {
  --portal-navy: #0A2A5E;
  --portal-navy-deep: #071c40;
  --portal-blue: #1A7CFF;
  --portal-blue-hover: #0e65d9;
  --portal-cyan: #00CFFF;
  --portal-ink: #1e293b;
  --portal-ink-muted: #64748b;
  --portal-border: #e2e8f0;
  --portal-border-focus: #1A7CFF;
  --portal-bg: #f8fafc;
  --portal-surface: #ffffff;
  --portal-error: #ef4444;
  --portal-error-bg: #fef2f2;
  --portal-success: #10b981;
  --portal-success-bg: #ecfdf5;
  --portal-warning: #f59e0b;
  --portal-warning-bg: #fffbeb;
}

/* Page Layout */
.portal-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--portal-bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(26, 124, 255, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 207, 255, 0.05) 0px, transparent 50%),
    linear-gradient(to right, rgba(10, 42, 94, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 42, 94, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  color: var(--portal-ink);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.portal-header {
  border-bottom: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-brand-plate {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(10, 42, 94, 0.08);
  border: 1px solid rgba(10, 42, 94, 0.08);
}

.portal-brand-img {
  width: 145px;
  height: auto;
  display: block;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--portal-navy);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  background: #ffffff;
  transition: all 0.2s ease;
}

.portal-back-link:hover {
  border-color: var(--portal-blue);
  color: var(--portal-blue);
  box-shadow: 0 2px 6px rgba(26, 124, 255, 0.1);
  transform: translateX(-2px);
}

.portal-security-badge {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--portal-ink-muted);
  background: rgba(10, 42, 94, 0.04);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(10, 42, 94, 0.06);
}

@media (min-width: 640px) {
  .portal-security-badge {
    display: inline-flex;
  }
}

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

.portal-card {
  width: 100%;
  max-width: 460px;
  background: var(--portal-surface);
  border-radius: 16px;
  border: 1px solid rgba(10, 42, 94, 0.1);
  box-shadow: 
    0 4px 6px -1px rgba(10, 42, 94, 0.05),
    0 12px 28px -4px rgba(10, 42, 94, 0.08);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  animation: portalFadeIn 0.35s ease-out;
}

@keyframes portalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--portal-navy) 0%, var(--portal-blue) 50%, var(--portal-cyan) 100%);
}

.portal-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.portal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--portal-navy);
  background: rgba(26, 124, 255, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.portal-title {
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-size: 26px;
  font-weight: 800;
  color: var(--portal-navy);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.portal-subtitle {
  font-size: 14px;
  color: var(--portal-ink-muted);
  margin: 0;
  line-height: 1.5;
}

/* Forms & Fields */
.portal-form-group {
  margin-bottom: 20px;
}

.portal-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--portal-navy);
  margin-bottom: 7px;
}

.portal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.portal-input-icon {
  position: absolute;
  left: 14px;
  color: var(--portal-ink-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.portal-input {
  width: 100%;
  height: 46px;
  padding: 10px 14px 10px 42px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1.5px solid var(--portal-border);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.portal-input:focus {
  border-color: var(--portal-border-focus);
  box-shadow: 0 0 0 3px rgba(26, 124, 255, 0.15);
}

.portal-input.is-invalid {
  border-color: var(--portal-error);
  background-color: var(--portal-error-bg);
}

.portal-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.portal-input-wrap:focus-within .portal-input-icon {
  color: var(--portal-blue);
}

/* Password Toggle */
.portal-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--portal-ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.18s ease, background 0.18s ease;
}

.portal-toggle-btn:hover {
  color: var(--portal-navy);
  background: rgba(10, 42, 94, 0.05);
}

.portal-toggle-btn:focus-visible {
  outline: 2px solid var(--portal-blue);
}

.portal-field-error {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--portal-error);
  margin-top: 5px;
  min-height: 16px;
}

/* Row Utilities */
.portal-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13.5px;
}

.portal-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--portal-ink);
  user-select: none;
}

.portal-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--portal-blue);
  cursor: pointer;
  margin: 0;
}

.portal-link {
  color: var(--portal-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  cursor: pointer;
}

.portal-link:hover {
  color: var(--portal-blue-hover);
  text-decoration: underline;
}

/* Submit Button */
.portal-submit-btn {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--portal-blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display, 'Manrope', sans-serif);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(26, 124, 255, 0.25);
  position: relative;
}

.portal-submit-btn:hover {
  background: var(--portal-blue-hover);
  box-shadow: 0 6px 16px rgba(26, 124, 255, 0.35);
  transform: translateY(-1px);
}

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

.portal-submit-btn:disabled,
.portal-submit-btn.is-loading {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.portal-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: portalSpin 0.7s linear infinite;
}

.portal-submit-btn.is-loading .portal-spinner {
  display: inline-block;
}

.portal-submit-btn.is-loading .portal-btn-text {
  opacity: 0.85;
}

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

/* Status / Alert Banners */
.portal-alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: portalFadeIn 0.25s ease-out;
}

.portal-alert--error {
  background: var(--portal-error-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.portal-alert--notice {
  background: #f0f7ff;
  color: #075985;
  border: 1px solid #bae6fd;
}

.portal-alert--success {
  background: var(--portal-success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.portal-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.portal-alert-content {
  flex: 1;
}

.portal-alert-title {
  font-weight: 700;
  margin-bottom: 2px;
}

/* Card Views (Login / Forgot Password / Session) */
.portal-view {
  display: block;
}

.portal-view.is-hidden {
  display: none;
}

/* Helpdesk Info */
.portal-help-card {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--portal-border);
  text-align: center;
  font-size: 13px;
  color: var(--portal-ink-muted);
}

.portal-help-card a {
  color: var(--portal-blue);
  text-decoration: none;
  font-weight: 600;
}

.portal-help-card a:hover {
  text-decoration: underline;
}

/* Active Session Card */
.portal-session-box {
  background: #f8fafc;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.portal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--portal-navy);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.portal-session-id {
  font-weight: 700;
  color: var(--portal-navy);
  font-size: 16px;
  margin: 0 0 4px 0;
}

.portal-session-status {
  font-size: 13px;
  color: var(--portal-success);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.portal-session-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--portal-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.portal-signout-btn {
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--portal-ink);
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.portal-signout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Footer */
.portal-footer {
  border-top: 1px solid var(--portal-border);
  background: #ffffff;
  padding: 18px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--portal-ink-muted);
}

.portal-footer a {
  color: var(--portal-ink-muted);
  text-decoration: none;
}

.portal-footer a:hover {
  color: var(--portal-navy);
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .portal-card {
    padding: 28px 20px;
    border-radius: 12px;
  }
  .portal-title {
    font-size: 22px;
  }
  .portal-header-inner {
    padding: 12px 16px;
  }
  .portal-brand-img {
    width: 125px;
  }
  .portal-back-link span {
    display: none;
  }
}
