/* ============================================
   PETROLINK CLOUD - Login/SaaS Stylesheet
   Brand: Dark Blue (#061B3D) + Gold (#D9A441)
   ============================================ */

:root {
  --petro-primary: #061B3D;
  --petro-secondary: #0A2D63;
  --petro-deep: #021024;
  --petro-gold: #D9A441;
  --petro-gold-light: #F4C766;
  --petro-white: #FFFFFF;
  --petro-bg: #F6F8FC;
  --petro-text: #172033;
  --petro-muted: #7A869A;
  --petro-border: #E4E9F2;
  --petro-danger: #DC2626;
  --petro-success: #16A34A;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--petro-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT WRAPPER
   ============================================ */
.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ============================================
   LEFT PANEL — HERO / BRANDING
   ============================================ */
.login-hero {
  flex: 0 0 58%;
  position: relative;
  background: var(--petro-primary);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}

.login-hero-image {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Animated gradient overlay */
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(217, 164, 65, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(217, 164, 65, 0.05) 0%, transparent 60%);
  z-index: 0;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Circuit / grid pattern overlay */
.login-hero::after {
  content: '';
  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: 60px 60px;
  z-index: 1;
  pointer-events: none;
}

.login-hero::before,
.login-hero::after {
  display: none;
}

/* Floating glowing dots */
.hero-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.hero-dot-1 {
  width: 6px;
  height: 6px;
  background: var(--petro-gold);
  top: 15%;
  right: 25%;
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.4);
  animation: dotFloat 5s ease-in-out infinite;
}

.hero-dot-2 {
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.4);
  bottom: 35%;
  left: 12%;
  animation: dotFloat 7s ease-in-out infinite 1s;
}

.hero-dot-3 {
  width: 8px;
  height: 8px;
  background: var(--petro-gold);
  top: 45%;
  right: 15%;
  box-shadow: 0 0 16px rgba(217, 164, 65, 0.3);
  animation: dotFloat 6s ease-in-out infinite 0.5s;
}

.hero-dot-4 {
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.5);
  top: 22%;
  left: 30%;
  animation: dotFloat 8s ease-in-out infinite 2s;
}

.hero-dot-5 {
  width: 5px;
  height: 5px;
  background: rgba(217, 164, 65, 0.6);
  bottom: 18%;
  right: 30%;
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.3);
  animation: dotFloat 6.5s ease-in-out infinite 1.5s;
}

@keyframes dotFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { transform: translateY(-16px) scale(1.2); opacity: 1; }
}

/* Wave shape at bottom */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  z-index: 3;
  pointer-events: none;
}

.hero-wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Gold accent curve */
.hero-accent {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(217, 164, 65, 0.12);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.hero-accent-2 {
  top: -100px;
  right: -30px;
  width: 400px;
  height: 400px;
  border-color: rgba(217, 164, 65, 0.06);
}

/* Left panel content */
.hero-content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Logo area (top-left) */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: auto;
}

.hero-brand-logo {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
}

.hero-brand-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hero-brand-text {
  display: flex;
  flex-direction: column;
}

.hero-brand-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--petro-white);
  letter-spacing: 0.05em;
}

.hero-brand-text span {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--petro-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Hero center content */
.hero-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(217, 164, 65, 0.1);
  border: 1px solid rgba(217, 164, 65, 0.15);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--petro-gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.hero-tagline::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--petro-gold);
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-headline {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--petro-white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero-headline span {
  background: linear-gradient(135deg, var(--petro-gold), var(--petro-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 2rem;
}

/* Feature pills */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: all 0.25s ease;
  cursor: default;
}

.hero-feature:hover {
  background: rgba(217, 164, 65, 0.1);
  border-color: rgba(217, 164, 65, 0.2);
  color: var(--petro-gold-light);
  transform: translateY(-1px);
}

.hero-feature i {
  font-size: 0.7rem;
  color: var(--petro-gold);
}

/* Bottom security bar */
.hero-security {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

.security-item i {
  font-size: 0.8rem;
  color: var(--petro-gold);
  opacity: 0.6;
}

/* ============================================
   RIGHT PANEL — LOGIN CARD
   ============================================ */
.login-form-panel {
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--petro-bg);
  position: relative;
}

/* Decorative gold line on right side */
.login-form-panel::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 0;
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, transparent, var(--petro-gold), transparent);
  opacity: 0.3;
  border-radius: 0 2px 2px 0;
}

/* Login card */
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(6, 27, 61, 0.12), 0 10px 30px rgba(6, 27, 61, 0.06);
  border: 1px solid rgba(255,255,255,0.7);
  padding: 2.5rem 2.25rem;
  animation: cardFadeIn 0.8s ease forwards;
  position: relative;
}

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

/* Help link */
.help-link {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--petro-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-link:hover {
  color: var(--petro-gold);
}

.help-link i {
  font-size: 0.85rem;
}

/* Logo circle */
.login-logo-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.25rem;
  background: var(--petro-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(6, 27, 61, 0.12);
  border: 3px solid rgba(217, 164, 65, 0.25);
  animation: floatLogo 4s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}

.login-logo-circle:hover {
  box-shadow: 0 16px 50px rgba(6, 27, 61, 0.18);
}

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

.login-logo-circle img {
  max-width: 72px;
  max-height: 72px;
  object-fit: contain;
}

/* Login card header text */
.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--petro-text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.login-header p {
  font-size: 0.85rem;
  color: var(--petro-muted);
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--petro-text);
  margin-bottom: 0.45rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--petro-muted);
  font-size: 1rem;
  transition: color 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.form-control {
  width: 100%;
  height: 54px;
  padding: 0.75rem 1rem 0.75rem 2.9rem;
  border: 1.5px solid var(--petro-border);
  border-radius: 14px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--petro-text);
  background: var(--petro-white);
  transition: all 0.25s ease;
  outline: none;
}

.form-control:hover {
  border-color: #cdd3df;
}

.form-control:focus {
  border-color: var(--petro-gold);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.12);
  background: var(--petro-white);
}

.form-control:focus ~ .input-icon {
  color: var(--petro-gold);
}

.form-control::placeholder {
  color: #b0b8c8;
  font-size: 0.8125rem;
}

.form-control.is-invalid {
  border-color: var(--petro-danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.invalid-feedback {
  font-size: 0.75rem;
  color: var(--petro-danger);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.invalid-feedback::before {
  content: '\F333';
  font-family: 'bootstrap-icons';
  font-size: 0.7rem;
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--petro-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  transition: color 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--petro-gold);
}

/* Form options row */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--petro-border);
  accent-color: var(--petro-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--petro-primary);
  border-color: var(--petro-primary);
}

.form-check-label {
  font-size: 0.8rem;
  color: var(--petro-muted);
  cursor: pointer;
  user-select: none;
}

.forgot-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--petro-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: var(--petro-gold);
  text-decoration: underline;
}

/* Sign In button */
.btn-login {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #061B3D, #0A2D63);
  color: var(--petro-white);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 10px 28px rgba(6, 27, 61, 0.2);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(217, 164, 65, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(6, 27, 61, 0.28), 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.btn-login:hover::before {
  opacity: 1;
}

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

.btn-login i {
  font-size: 1.05rem;
}

/* Loading state */
.btn-login.loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn-login.loading .btn-text {
  visibility: hidden;
}

.btn-login.loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: var(--petro-white);
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

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

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: alertSlide 0.35s ease-out;
}

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

.alert i {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.alert-danger {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.alert-success {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

/* ============================================
   SECURITY FOOTNOTE
   ============================================ */
.login-security {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--petro-border);
}

.login-security p {
  font-size: 0.7rem;
  color: var(--petro-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.login-security i {
  color: var(--petro-gold);
  font-size: 0.75rem;
}

/* ============================================
   SESSION MESSAGE
   ============================================ */
.session-status {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .login-hero {
    flex: 0 0 50%;
    padding: 2rem;
  }
  .login-form-panel {
    flex: 0 0 50%;
  }
  .hero-headline {
    font-size: 2rem;
  }
}

@media (max-width: 820px) {
  .login-hero {
    display: none;
  }
  .login-form-panel {
    flex: 0 0 100%;
    padding: 1.5rem;
  }
  .login-form-panel::before {
    display: none;
  }
  .login-card {
    max-width: 420px;
    padding: 2rem 1.75rem;
    border-radius: 24px;
  }
}

@media (max-width: 480px) {
  .login-form-panel {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }
  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(6, 27, 61, 0.1);
  }
  .login-logo-circle {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
  }
  .login-logo-circle img {
    max-width: 58px;
    max-height: 58px;
  }
  .login-header h2 {
    font-size: 1.2rem;
  }
  .form-control {
    height: 48px;
    font-size: 0.8125rem;
    padding-left: 2.6rem;
    border-radius: 12px;
  }
  .btn-login {
    height: 50px;
    font-size: 0.875rem;
    border-radius: 12px;
  }
}
