/* ==========================================================================
   GROW SYNC - Modern Design System & Login Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Fonts & CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  /* Color Palette - Modern Minimal Soft & Tech */
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f8fafc 100%);
  --panel-bg: #ffffff;
  --visual-bg: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);

  /* Primary & Accents */
  --color-primary-navy: #243746;       /* 다크 슬레이트 네이비 (메인 버튼) */
  --color-primary-navy-hover: #17242f; /* 호버 상태 */
  --color-primary-blue: #2563eb;       /* 하이라이트 블루 */
  --color-primary-blue-hover: #1d4ed8;
  --color-eco-green: #10b981;          /* 친환경 에코 그린 / 정상 상태 */

  /* Sensor Accent Colors */
  --sensor-temp-bg: #fee2e2;
  --sensor-temp-color: #ef4444;
  --sensor-ph-bg: #dbeafe;
  --sensor-ph-color: #3b82f6;
  --sensor-humidity-bg: #ede9fe;
  --sensor-humidity-color: #8b5cf6;
  --sensor-wind-bg: #d1fae5;
  --sensor-wind-color: #059669;

  /* Typography Colors */
  --text-main: #0f172a;                /* 가장 진한 타이틀 */
  --text-secondary: #475569;           /* 본문 / 라벨 */
  --text-muted: #64748b;               /* 서브 텍스트 */
  --text-placeholder: #94a3b8;         /* 힌트 텍스트 */

  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --border-focus: #2563eb;
  --shadow-card: 0 24px 64px -12px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-input-focus: 0 0 0 4px rgba(37, 99, 235, 0.12);
  --shadow-button: 0 12px 24px -6px rgba(36, 55, 70, 0.32);
  --shadow-floating: 0 12px 28px -6px rgba(15, 23, 42, 0.12);

  /* Radius */
  --radius-card: 28px;
  --radius-input: 14px;
  --radius-btn: 14px;
  --radius-badge: 50%;

  /* Font */
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Setup
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. Main Card Container (Split Layout)
   -------------------------------------------------------------------------- */
.login-container-card {
  width: 100%;
  max-width: 1060px;
  min-height: 640px;
  background: var(--panel-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   4. Left Side: Visual & Branding Panel
   -------------------------------------------------------------------------- */
.visual-panel {
  background: var(--visual-bg);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(226, 232, 240, 0.7);
}

/* Background Ambient Glows & Rings */
.visual-panel::before {
  content: '';
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  background: radial-gradient(circle at 50% 65%, rgba(219, 234, 254, 0.45) 0%, rgba(248, 250, 252, 0) 70%);
  pointer-events: none;
}

.brand-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon-wrap {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  color: var(--color-primary-navy);
}

.brand-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.2px;
  margin-top: 2px;
}

/* Hero Typography */
.visual-intro {
  position: relative;
  z-index: 2;
  margin-top: 32px;
}

.visual-headline {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.8px;
  color: var(--text-main);
}

.visual-headline .highlight {
  color: var(--color-primary-navy);
  display: inline-block;
}

.visual-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 14px;
  font-weight: 400;
  letter-spacing: -0.3px;
}

/* 3D Device & Floating Sensor Badges Stage */
.device-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0 10px;
  min-height: 260px;
}

/* Subtle Orbit Rings */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-ring.outer {
  width: 320px;
  height: 320px;
  border: 1.5px dashed rgba(203, 213, 225, 0.7);
  animation: spinSlow 50s linear infinite;
}

.orbit-ring.inner {
  width: 250px;
  height: 250px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(241, 245, 249, 0) 70%);
}

/* Main 3D Device */
.device-img-wrapper {
  position: relative;
  z-index: 3;
  width: 230px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatDevice 6s ease-in-out infinite;
}

.device-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 28px;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 18px 30px rgba(36, 55, 70, 0.15));
}

/* Floating Sensor Badges */
.floating-badge {
  position: absolute;
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-badge:hover {
  transform: scale(1.15) !important;
}

.floating-badge svg {
  width: 22px;
  height: 22px;
}

/* Sensor Badge Positions & Colors (Smart Fertigation: EC, pH, Dosing, Temp) */
.floating-badge .badge-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.badge-ec {
  top: 14%;
  left: 6%;
  background: #ffffff;
  color: var(--sensor-wind-color);
  animation: floatBadgeA 4.5s ease-in-out infinite;
}
.badge-ec .icon-circle {
  background: var(--sensor-wind-bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11.5px;
}

.badge-ph {
  top: 8%;
  right: 12%;
  background: #ffffff;
  color: var(--sensor-ph-color);
  animation: floatBadgeB 5s ease-in-out infinite 0.5s;
}
.badge-ph .icon-circle {
  background: var(--sensor-ph-bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11.5px;
}

.badge-dosing {
  bottom: 10%;
  right: 8%;
  background: #ffffff;
  color: var(--sensor-humidity-color);
  animation: floatBadgeA 5.2s ease-in-out infinite 1s;
}
.badge-dosing .icon-circle {
  background: var(--sensor-humidity-bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-temp {
  bottom: 14%;
  left: 10%;
  background: #ffffff;
  color: var(--sensor-temp-color);
  animation: floatBadgeB 4.8s ease-in-out infinite 1.5s;
}
.badge-temp .icon-circle {
  background: var(--sensor-temp-bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   5. Right Side: Login Form Panel
   -------------------------------------------------------------------------- */
.form-panel {
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.form-inner {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.login-header {
  margin-bottom: 32px;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: -0.2px;
}

/* Inline Alert Message */
.alert-banner {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  align-items: center;
  gap: 10px;
  animation: fadeInDown 0.3s ease-out forwards;
}

.alert-banner.error {
  display: flex;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #dc2626;
}

.alert-banner svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Input Fields Container */
.form-group {
  margin-bottom: 16px;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-input);
  transition: all 0.2s ease;
  height: 52px;
  padding: 0 16px;
}

.input-box:focus-within {
  border-color: var(--color-primary-blue);
  box-shadow: var(--shadow-input-focus);
}

.input-box .field-icon {
  width: 20px;
  height: 20px;
  color: var(--text-placeholder);
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.input-box:focus-within .field-icon {
  color: var(--color-primary-blue);
}

.input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  height: 100%;
}

.input-box input::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

/* Action buttons inside input (Clear & Eye toggle) */
.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
}

.input-btn.visible {
  display: flex;
}

.input-btn:hover {
  color: var(--text-secondary);
  background: #f1f5f9;
}

.input-btn svg {
  width: 18px;
  height: 18px;
}

/* Options Row (Keep Login & Find Password) */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 24px;
  font-size: 14px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  gap: 8px;
}

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

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background-color: var(--color-primary-navy);
  border-color: var(--color-primary-navy);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.find-pass-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s;
}

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

/* Submit Login Button */
.btn-submit {
  width: 100%;
  height: 52px;
  background: var(--color-primary-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-button);
}

.btn-submit:hover:not(:disabled) {
  background: var(--color-primary-navy-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -6px rgba(36, 55, 70, 0.4);
}

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

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-submit .arrow-icon {
  transition: transform 0.2s ease;
}

.btn-submit:hover .arrow-icon {
  transform: translateX(3px);
}

/* Spinner for Loading */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spinSlow 0.8s linear infinite;
}

.btn-submit.loading .btn-text,
.btn-submit.loading .arrow-icon {
  display: none;
}

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

/* Divider & Social Login */
.divider-row {
  display: flex;
  align-items: center;
  margin: 22px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--border-light);
}

.divider-text {
  padding: 0 16px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.btn-google {
  width: 100%;
  height: 50px;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

/* Footer Bottom Links & Logo */
.form-footer {
  margin-top: 32px;
  text-align: center;
}

.register-prompt {
  font-size: 14px;
  color: var(--text-muted);
}

.register-link {
  color: var(--color-primary-blue);
  font-weight: 700;
  text-decoration: none;
  margin-left: 6px;
  transition: color 0.2s;
}

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

.company-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-footer img {
  height: 30px;
  opacity: 1;
  filter: none;
  transition: transform 0.2s ease;
}

.company-footer img:hover {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   6. Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes floatDevice {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes floatBadgeA {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes floatBadgeB {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

/* --------------------------------------------------------------------------
   7. Responsive Breakpoints (PC, Tablet, Mobile)
   -------------------------------------------------------------------------- */

/* Tablet (Landscape & Portrait) */
@media screen and (max-width: 1024px) {
  body {
    padding: 16px;
  }

  .login-container-card {
    max-width: 860px;
    min-height: 580px;
  }

  .visual-panel {
    padding: 36px 32px;
  }

  .visual-headline {
    font-size: 26px;
  }

  .form-panel {
    padding: 42px 36px;
  }

  .device-stage {
    min-height: 220px;
  }

  .device-img-wrapper {
    width: 170px;
    height: 170px;
  }

  .orbit-ring.outer {
    width: 270px;
    height: 270px;
  }

  .orbit-ring.inner {
    width: 210px;
    height: 210px;
  }
}

/* Mobile Screen (Smartphones & Narrow Screens: <= 768px) */
@media screen and (max-width: 768px) {
  body {
    padding: 12px;
    background: #f8fafc;
    align-items: center;
  }

  .login-container-card {
    grid-template-columns: 1fr;
    max-width: 460px;
    min-height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  }

  /* Hide the large 3D device stage on mobile for space efficiency */
  .visual-panel {
    display: none;
  }

  .form-panel {
    padding: 36px 24px 28px;
  }

  /* Mobile Top Brand Bar (Visible only on mobile) */
  .mobile-brand-bar {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    text-align: center;
  }

  .mobile-brand-bar .brand-icon-wrap {
    width: 38px;
    height: 38px;
    background: #edf3fa;
  }

  .mobile-brand-bar .brand-title {
    font-size: 17px;
  }

  .login-header {
    text-align: center;
    margin-bottom: 24px;
  }

  .login-title {
    font-size: 24px;
  }

  .input-box {
    height: 50px;
  }

  .btn-submit {
    height: 50px;
    font-size: 15px;
  }

  .btn-google {
    height: 48px;
    font-size: 14px;
  }

  .form-footer {
    margin-top: 24px;
  }

  .company-footer {
    margin-top: 18px;
  }
}

/* Extra small mobile (<= 380px) */
@media screen and (max-width: 380px) {
  .form-panel {
    padding: 28px 18px 22px;
  }

  .options-row {
    font-size: 12.5px;
  }
}

/* Hidden by default on PC / Tablet */
.mobile-brand-bar {
  display: none;
}

/* Intro Page Link Banner & Buttons */
.intro-banner-wrap {
  margin: 18px 0 20px;
}

.btn-intro-landing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  padding: 12px 16px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
}

.btn-intro-landing:hover {
  transform: translateY(-2px);
  border-color: #34d399;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.16);
  background: linear-gradient(135deg, #dcfce7 0%, #e0f2fe 100%);
}

.intro-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.intro-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #065f46;
  letter-spacing: -0.2px;
}

.intro-arrow {
  width: 18px;
  height: 18px;
  color: #10b981;
  transition: transform 0.2s ease;
}

.btn-intro-landing:hover .intro-arrow {
  transform: translateX(3px);
}

/* Left Visual Panel Intro Button */
.visual-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 18px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  color: #065f46;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
}

.visual-intro-btn:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

/* Mobile Brand Bar Right Link */
.mobile-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 5px 10px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}
