:root {
  --accent: #00aaff;
  --accent-hover: #0088cc;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --bg-dark: #0e1318;
  --card-bg: #151b22;
  --input-bg: #1e2630;
  --border: #2d3748;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-dark);
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.left-panel {
  position: relative;
  flex: 1;
  overflow: hidden;
  height: 100vh;
  background-color: var(--bg-dark);
}

.carousel {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.8s ease-in-out;
  height: 100%;
  width: 400%;
}

.slide {
  position: relative;
  flex: 1 0 25%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #111827;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 19, 24, 0.2) 0%, rgba(14, 19, 24, 0.85) 100%);
}

.slide-text {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 32px 40px;
  width: 100%;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #f3f4f6;
  z-index: 2;
  max-width: 80%;
}

.slide-indicators {
  position: absolute;
  bottom: 20px;
  right: 40px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.indicator.active {
  background: var(--accent);
  width: 24px;
  border-radius: 5px;
}

.right-panel {
  width: 420px;
  max-width: 100%;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 36px;
  z-index: 5;
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  text-align: center;
  width: 100%;
}

.brand-logos {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
  height: 42px;
}

.brand-logos img.engie-logo {
  height: 32px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

.brand-logos .brand-divider {
  display: inline-block;
  width: 1px;
  height: 24px;
  background-color: var(--border);
}

.brand-logos img.partner-logo {
  height: 22px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  opacity: 0.95;
}

.brand-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.brand-header p {
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-form-card {
  width: 100%;
}

.auth-step {
  display: none;
  width: 100%;
}

.auth-step.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: #fff;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00aaff, #0077cc);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.back-btn:hover {
  text-decoration: underline;
}

.alert-box {
  display: none;
  font-size: 0.82rem;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 6px;
  text-align: center;
}

.alert-box.error {
  display: block;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-box.success {
  display: block;
  color: #51cf66;
  background: rgba(81, 207, 102, 0.12);
  border: 1px solid rgba(81, 207, 102, 0.3);
}

.forgot-link {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.ms-login-btn {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
}

.ms-login-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #4a5568;
}

.ms-icon {
  width: 18px;
  height: 18px;
}

.otp-header-info {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.otp-input {
  text-align: center;
  font-size: 1.5rem !important;
  letter-spacing: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

.resend-row {
  text-align: center;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.password-rules {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.password-rules small {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.password-rules ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ef4444;
}

.password-rules li.valid {
  color: #10b981;
}

@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  .left-panel {
    height: 240px;
  }
  .right-panel {
    width: 100%;
    padding: 30px 20px;
  }
}
