@import 'base.css';
@import 'yuzmedya-credit.css';

/* ─── Page Shell ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
  background: #EEF3F9;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orbFloat 12s ease-in-out infinite;
}

.auth-orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(46, 97, 148, 0.25);
  top: -120px;
  left: -80px;
}

.auth-orb-2 {
  width: 320px;
  height: 320px;
  background: rgba(82, 156, 167, 0.22);
  bottom: -60px;
  right: 20%;
  animation-delay: -4s;
}

.auth-orb-3 {
  width: 260px;
  height: 260px;
  background: rgba(49, 75, 113, 0.18);
  top: 40%;
  right: -60px;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 25px) scale(0.95); }
}

/* ─── Left Panel ─── */
.auth-left {
  flex: 1.1;
  background: linear-gradient(145deg, var(--primary-darker) 0%, var(--primary) 45%, var(--accent) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ─── Visual Orbit (role icons) ─── */
.auth-visual {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 36px;
  z-index: 2;
}

.auth-orbit {
  position: absolute;
  inset: 0;
  animation: orbitSpin 24s linear infinite;
}

.auth-orbit-reverse {
  animation: orbitSpin 18s linear infinite reverse;
}

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

.orbit-item {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: orbitItemBob 3s ease-in-out infinite;
}

.orbit-item i { animation: counterSpin 24s linear infinite; }

.auth-orbit-reverse .orbit-item i {
  animation: counterSpin 18s linear infinite reverse;
}

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

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

.orbit-item-1 { top: 0; left: 50%; margin-left: -26px; animation-delay: 0s; }
.orbit-item-2 { top: 50%; right: 0; margin-top: -26px; animation-delay: -0.75s; }
.orbit-item-3 { bottom: 0; left: 50%; margin-left: -26px; animation-delay: -1.5s; }
.orbit-item-4 { top: 50%; left: 0; margin-top: -26px; animation-delay: -2.25s; }

.orbit-item-5 {
  top: 18%;
  right: 18%;
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
  border-radius: 12px;
  animation-delay: -1s;
}

.orbit-item-6 {
  bottom: 18%;
  left: 18%;
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
  border-radius: 12px;
  animation-delay: -2s;
}

.auth-visual-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 28px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: centerPulse 4s ease-in-out infinite;
}

@keyframes centerPulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 0 rgba(255,255,255,0.2); }
  50% { box-shadow: 0 16px 48px rgba(0,0,0,0.25), 0 0 0 12px rgba(255,255,255,0); }
}

.auth-visual-center svg,
.auth-visual-center .logo-placeholder svg {
  width: 56px;
  height: 56px;
}

.auth-brand {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 2;
  animation: fadeSlideUp 0.7s ease both;
}

.auth-brand h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.auth-brand h1 span { font-weight: 400; opacity: 0.88; }

.auth-brand p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 380px;
  line-height: 1.65;
}

.auth-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 18px;
  border-radius: 50px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

/* ─── Feature Cards ─── */
.auth-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
}

.auth-feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  color: white;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeSlideUp 0.6s ease both;
  cursor: default;
}

.auth-feature-card:nth-child(1) { animation-delay: 0.15s; }
.auth-feature-card:nth-child(2) { animation-delay: 0.25s; }
.auth-feature-card:nth-child(3) { animation-delay: 0.35s; }

.auth-feature-card:hover {
  background: rgba(255,255,255,0.16);
  transform: translateX(8px);
  border-color: rgba(255,255,255,0.28);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 0.35s ease;
}

.auth-feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-5deg);
}

.feature-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.feature-text span {
  font-size: 0.8rem;
  opacity: 0.78;
  line-height: 1.4;
}

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

/* ─── Right Panel / Form ─── */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  position: relative;
  z-index: 1;
}

.auth-form-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow:
    0 4px 6px rgba(46,97,148,0.04),
    0 24px 64px rgba(46,97,148,0.12);
  border: 1px solid rgba(255,255,255,0.8);
  animation: formEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}

@keyframes formEnter {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-form-header {
  margin-bottom: 28px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,97,148,0); }
  50% { box-shadow: 0 0 0 6px rgba(46,97,148,0.08); }
}

.role-badge.super-admin { background: linear-gradient(135deg, rgba(49,75,113,0.12), rgba(46,97,148,0.08)); color: var(--primary-darker); }
.role-badge.admin { background: linear-gradient(135deg, rgba(46,97,148,0.12), rgba(65,133,182,0.08)); color: var(--primary); }
.role-badge.bayi { background: linear-gradient(135deg, rgba(82,156,167,0.15), rgba(107,181,190,0.08)); color: #3D8A94; }
.role-badge.uretim { background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08)); color: #059669; }

.auth-form-header h2 {
  font-size: 1.85rem;
  color: var(--primary-darker);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-form-header .subtitle {
  color: var(--gray-dark);
  font-size: 0.95rem;
  line-height: 1.5;
}

.demo-pill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(46,97,148,0.06), rgba(82,156,167,0.06));
  border: 1px solid rgba(46,97,148,0.12);
  margin-bottom: 24px;
  font-size: 0.82rem;
  color: var(--primary);
  line-height: 1.5;
  animation: demoGlow 4s ease-in-out infinite;
}

@keyframes demoGlow {
  0%, 100% { border-color: rgba(46,97,148,0.12); }
  50% { border-color: rgba(82,156,167,0.35); }
}

.demo-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: iconBounce 2s ease-in-out infinite;
}

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

.demo-pill-error {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
  margin-bottom: 12px;
  animation: none;
}

.demo-accounts {
  align-items: flex-start;
  animation: none;
}

.demo-account-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.demo-account-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text, #334155);
  font-size: 0.8rem;
  line-height: 1.4;
}

.demo-account-list li span {
  min-width: 92px;
  font-weight: 600;
  color: var(--primary);
}

.demo-account-list li.is-current {
  background: rgba(46, 97, 148, 0.08);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 0 -8px;
}

/* ─── Form Fields ─── */
.auth-form .form-group {
  margin-bottom: 20px;
  animation: fadeSlideUp 0.5s ease both;
}

.auth-form .form-group:nth-child(1) { animation-delay: 0.2s; }
.auth-form .form-group:nth-child(2) { animation-delay: 0.3s; }

.auth-form .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-darker);
  margin-bottom: 8px;
  display: block;
}

.input-wrap {
  position: relative;
}

.input-wrap > i.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 0.95rem;
  transition: color 0.25s ease;
  z-index: 1;
  pointer-events: none;
}

.input-wrap:focus-within > i.field-icon {
  color: var(--primary);
}

.auth-form .form-control {
  width: 100%;
  padding: 15px 16px 15px 46px;
  border: 2px solid rgba(175,178,179,0.35);
  border-radius: 12px;
  font-size: 0.95rem;
  background: #FAFBFD;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form input[type="password"] {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.22em;
  -webkit-text-security: disc;
  text-security: disc;
}

.auth-form .input-wrap[data-password] input[type="text"] {
  font-family: var(--font) !important;
  letter-spacing: normal;
  -webkit-text-security: none;
  text-security: none;
}

.auth-form .form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(46,97,148,0.1);
}

.input-wrap .toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 1;
}

.input-wrap .toggle-pass:hover {
  color: var(--primary);
  background: rgba(46,97,148,0.06);
}

.input-wrap[data-password] .form-control {
  padding-right: 46px;
}

.auth-form .form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.85rem;
  animation: fadeSlideUp 0.5s ease both;
  animation-delay: 0.35s;
}

.auth-form .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-dark);
  cursor: pointer;
}

.auth-form .remember input { accent-color: var(--primary); width: 16px; height: 16px; }

.auth-form .forgot {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s;
}

.auth-form .forgot:hover { color: var(--accent); }

/* ─── Buttons ─── */
.btn-login {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(46,97,148,0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-login:hover::after { left: 100%; }

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(46,97,148,0.4);
}

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

.btn-login.teal {
  background: linear-gradient(135deg, var(--accent), #6BB5BE);
  box-shadow: 0 4px 16px rgba(82,156,167,0.35);
}

.btn-login.teal:hover { box-shadow: 0 8px 28px rgba(82,156,167,0.45); }

.btn-login.green {
  background: linear-gradient(135deg, #059669, var(--success));
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}

.btn-login.green:hover { box-shadow: 0 8px 28px rgba(16,185,129,0.45); }

.btn-demo {
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(82,156,167,0.15), rgba(46,97,148,0.1)) !important;
  color: var(--primary-darker) !important;
  border: 2px dashed rgba(82,156,167,0.45) !important;
  box-shadow: none !important;
}

.btn-demo:hover {
  background: linear-gradient(135deg, rgba(82,156,167,0.25), rgba(46,97,148,0.15)) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 16px rgba(82,156,167,0.2) !important;
}

.btn-demo i { animation: arrowSlide 1.5s ease-in-out infinite; }

@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ─── Portal Links ─── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
  color: var(--gray);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(175,178,179,0.5), transparent);
}

.auth-portal-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-portal-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  text-align: center;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 2px solid rgba(175,178,179,0.25);
  color: var(--gray-dark);
  background: #FAFBFD;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-portal-links a i { font-size: 0.85rem; opacity: 0.7; transition: transform 0.3s ease; }

.auth-portal-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(46,97,148,0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46,97,148,0.1);
}

.auth-portal-links a:hover i {
  transform: scale(1.15);
  opacity: 1;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--gray-dark);
  transition: color 0.2s;
}

.auth-back-link:hover { color: var(--primary); }

/* ─── Role accent overrides ─── */
.auth-page[data-role="super-admin"] .auth-left {
  background: linear-gradient(145deg, #1a2d4a 0%, var(--primary-darker) 35%, var(--primary) 70%, #3a7a9e 100%);
}

.auth-page[data-role="admin"] .auth-left {
  background: linear-gradient(145deg, #1e3a5f 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.auth-page[data-role="bayi"] .auth-left {
  background: linear-gradient(145deg, var(--primary-darker) 0%, #2a6b8a 45%, var(--accent) 100%);
}

.auth-page[data-role="uretim"] .auth-left {
  background: linear-gradient(145deg, #1a3d35 0%, #1e6b5a 40%, var(--success) 100%);
}

.auth-page[data-role="uretim"] .auth-orb-1 { background: rgba(16,185,129,0.2); }
.auth-page[data-role="uretim"] .auth-orb-2 { background: rgba(5,150,105,0.18); }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .auth-left { flex: none; padding: 40px 28px 32px; }
  .auth-visual { width: 180px; height: 180px; margin-bottom: 24px; }
  .auth-visual-center { width: 80px; height: 80px; border-radius: 22px; }
  .orbit-item { width: 44px; height: 44px; font-size: 1rem; }
  .orbit-item-1, .orbit-item-3 { margin-left: -22px; }
  .orbit-item-2, .orbit-item-4 { margin-top: -22px; }
  .auth-features { display: none; }
}

@media (max-width: 768px) {
  .auth-page { flex-direction: column; }
  .auth-right { padding: 24px 20px 40px; }
  .auth-form-card { padding: 32px 24px; border-radius: 20px; }
  .auth-brand h1 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
