/* ==========================================================================
   HDS AI Culture & Diagnosis System - Portal Signin Stylesheet
   File: portal_signin.css
   ========================================================================== */

:root {
  --portal-bg-base: #090d16;
  --portal-navy-deep: #0b132b;
  --portal-card-bg: rgba(15, 23, 42, 0.78);
  --portal-card-border: rgba(56, 189, 248, 0.22);
  --portal-accent: #0284c7;
  --portal-accent-light: #38bdf8;
  --portal-accent-glow: rgba(56, 189, 248, 0.35);
  --portal-text-primary: #f8fafc;
  --portal-text-secondary: #94a3b8;
  --portal-text-muted: #64748b;
  --portal-input-bg: rgba(15, 23, 42, 0.65);
  --portal-input-border: rgba(148, 163, 184, 0.2);
  --portal-input-focus: #38bdf8;
  --portal-tab-active-bg: rgba(2, 132, 199, 0.2);
  --portal-tab-active-border: #38bdf8;
  --portal-danger: #ef4444;
  --portal-success: #10b981;
  --portal-amber: #f59e0b;
}

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

body.portal-signin-body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--portal-bg-base);
  color: var(--portal-text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px;
}

/* Background Ambient Orbs */
.portal-bg-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.portal-bg-glow-1 {
  position: absolute;
  top: -150px;
  left: 20%;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.22) 0%, rgba(2, 132, 199, 0) 70%);
  filter: blur(80px);
  animation: portalPulse 8s infinite alternate ease-in-out;
}

.portal-bg-glow-2 {
  position: absolute;
  bottom: -180px;
  right: 15%;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.18) 0%, rgba(79, 70, 229, 0) 70%);
  filter: blur(90px);
  animation: portalPulse 10s infinite alternate-reverse ease-in-out;
}

.portal-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.2) 80%);
}

@keyframes portalPulse {
  0% { transform: scale(0.95) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.08) translate(20px, 20px); opacity: 1; }
}

/* Container */
.portal-signin-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Header Brand */
.portal-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.portal-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 18px;
  border-radius: 40px;
  backdrop-filter: blur(8px);
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.portal-brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.portal-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--portal-accent-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Main Card */
.portal-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-card-border);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.portal-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.portal-card-desc {
  font-size: 13px;
  color: var(--portal-text-secondary);
  margin-bottom: 22px;
}

/* 2-Mode Tab Navigation (간편 기명 / 무기명 익명) */
.portal-tab-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 22px;
}

.portal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--portal-text-secondary);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.portal-tab-btn i {
  font-size: 15px;
}

.portal-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.portal-tab-btn.active {
  background: var(--portal-tab-active-bg);
  border-color: var(--portal-tab-active-border);
  color: #38bdf8;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2);
}

/* Tutorial Section Styling */
.portal-tutorial-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.portal-tutorial-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: rgba(30, 41, 59, 0.55);
  border: 1.5px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.portal-tutorial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.portal-tutorial-card.admin {
  border-color: rgba(56, 189, 248, 0.35);
}
.portal-tutorial-card.admin:hover {
  background: rgba(2, 132, 199, 0.16);
  border-color: #38bdf8;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.22);
}

.portal-tutorial-card.leader {
  border-color: rgba(129, 140, 248, 0.35);
}
.portal-tutorial-card.leader:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: #818cf8;
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.22);
}

.portal-tutorial-card.member {
  border-color: rgba(148, 163, 184, 0.25);
}
.portal-tutorial-card.member:hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(148, 163, 184, 0.18);
}

.tutorial-card-left {
  display: flex;
  align-items: center;
  gap: 13px;
}

.tutorial-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.portal-tutorial-card.admin .tutorial-icon-box {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.portal-tutorial-card.leader .tutorial-icon-box {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

.portal-tutorial-card.member .tutorial-icon-box {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.tutorial-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tutorial-role-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-tutorial-card.admin .tutorial-role-title { color: #38bdf8; }
.portal-tutorial-card.leader .tutorial-role-title { color: #a5b4fc; }
.portal-tutorial-card.member .tutorial-role-title { color: #e2e8f0; }

.tutorial-role-desc {
  font-size: 11.5px;
  color: var(--portal-text-secondary);
  line-height: 1.35;
}

.tutorial-enter-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--portal-text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.portal-tutorial-card:hover .tutorial-enter-badge {
  background: #2563eb;
  color: #ffffff;
}

/* Info Banner Theme for Tutorial */
.info-tutorial {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

/* Tab Info Banner */
.portal-tab-info {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.info-named {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.info-anon {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.info-account {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

/* Toast Box */
.portal-toast {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease;
}

.portal-toast.error {
  display: flex;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.portal-toast.info {
  display: flex;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.portal-toast.success {
  display: flex;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

/* Form Styles */
.portal-form-group {
  margin-bottom: 16px;
}

.portal-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

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

.portal-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 14px;
  transition: color 0.2s;
  pointer-events: none;
}

.portal-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  background: var(--portal-input-bg);
  border: 1px solid var(--portal-input-border);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.portal-input::placeholder {
  color: #64748b;
  font-size: 13.5px;
}

.portal-input:focus {
  outline: none;
  border-color: var(--portal-input-focus);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.portal-input:focus + .portal-input-icon,
.portal-input-wrap:focus-within .portal-input-icon {
  color: #38bdf8;
}

.portal-pwd-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.portal-pwd-toggle:hover {
  color: #94a3b8;
}

/* Input Field Guidance & Security Notice (Master Console Standard) */
.portal-input-notice {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(7, 15, 30, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-left: 3px solid #0284c7;
  border-radius: 6px;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.portal-input-notice i {
  color: #38bdf8;
  font-size: 13px;
  margin-top: 2px;
  flex-shrink: 0;
}

.portal-input-notice strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Submit Button */
.portal-btn-submit {
  width: 100%;
  height: 48px;
  margin-top: 22px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}

.portal-btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.portal-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Footer Info */
.portal-footer-links {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--portal-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.portal-footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.portal-footer-links a:hover {
  color: #38bdf8;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Password Change Rules */
.pw-rule-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.pw-rule-item.valid {
  color: #10b981;
}
.pw-rule-item.valid i {
  color: #10b981;
}
.pw-rule-item.invalid {
  color: #ef4444;
}

/* Button support for member-select-card-btn */
button.member-select-card-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================================================
   Desktop-Only Mobile Access Restriction Overlay (< 1024px)
   ========================================================================== */
.portal-mobile-blocker {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #061121;
  color: #ffffff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  overflow-y: auto;
}

.portal-mobile-blocker .blocker-card {
  max-width: 440px;
  width: 100%;
  background: #0b1b32;
  border: 1px solid #1e3a5f;
  border-radius: 16px;
  padding: 36px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.portal-mobile-blocker .blocker-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 120px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.portal-mobile-blocker .blocker-logo-wrap {
  margin-bottom: 20px;
  position: relative;
}

.portal-mobile-blocker .blocker-logo {
  height: 36px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.portal-mobile-blocker .blocker-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.portal-mobile-blocker .blocker-icon-main {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.15);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #38bdf8;
}

.portal-mobile-blocker .blocker-icon-ban {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid #0b1b32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #ffffff;
}

.portal-mobile-blocker .blocker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.portal-mobile-blocker .blocker-title {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.portal-mobile-blocker .blocker-desc {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0 0 22px 0;
  word-break: keep-all;
}

.portal-mobile-blocker .blocker-desc strong {
  color: #e2e8f0;
}

.portal-mobile-blocker .blocker-spec-box {
  background: #071324;
  border: 1px solid #162a45;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
  text-align: left;
  font-size: 12px;
}

.portal-mobile-blocker .blocker-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 1px solid #13243a;
  padding-bottom: 8px;
}

.portal-mobile-blocker .blocker-spec-label {
  color: #64748b;
}

.portal-mobile-blocker .blocker-spec-val-ok {
  color: #38bdf8;
  font-weight: 700;
}

.portal-mobile-blocker .blocker-spec-val-cur {
  color: #f87171;
  font-weight: 700;
}

.portal-mobile-blocker .blocker-spec-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}

.portal-mobile-blocker .blocker-spec-note i {
  color: #38bdf8;
}

.portal-mobile-blocker .blocker-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-mobile-blocker .blocker-btn-reload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.portal-mobile-blocker .blocker-btn-reload:hover {
  background: #0369a1;
}

@media (max-width: 1023px) {
  #portalMobileBlocker {
    display: flex !important;
  }

  .portal-signin-container,
  .portal-bg-wrapper {
    display: none !important;
  }

  body.portal-signin-body {
    overflow: hidden !important;
    background: #061121 !important;
  }
}

@media (min-width: 1024px) {
  #portalMobileBlocker {
    display: none !important;
  }
}


