@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');
@import 'variables.css';

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-page {
  font-family: var(--font);
  min-height: 100vh;
  background: var(--surface-2);
  color: var(--text);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Brand panel */
.auth-brand-panel {
  position: relative;
  background: linear-gradient(155deg, #0f3f3c 0%, #134e4a 35%, #0d9488 70%, #14b8a6 100%);
  color: var(--text-inverse);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(45, 212, 191, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.2) 0%, transparent 45%);
  pointer-events: none;
}

.auth-brand-panel > * { position: relative; z-index: 1; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #5eead4;
}

.auth-brand-content { max-width: 420px; }

.auth-brand-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.auth-brand-content p {
  font-size: 1rem;
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.auth-features li i {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #99f6e4;
  flex-shrink: 0;
}

.auth-brand-footer {
  font-size: 0.8rem;
  opacity: 0.55;
}

/* Form panel */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--surface);
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.auth-form-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-form-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.lang-switch {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.lang-switch button.active {
  background: var(--primary);
  color: #fff;
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.auth-field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.auth-field input::placeholder { color: var(--text-muted); }

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.auth-options label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-options a:hover { text-decoration: underline; }

.btn-auth-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth-primary:hover { background: var(--primary-dark); }
.btn-auth-primary:active { transform: scale(0.99); }

[dir="rtl"] .login-arrow { transform: scaleX(-1); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-auth-secondary {
  width: 100%;
  padding: 0.7rem;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-logo { display: flex; }
  .auth-form-panel { min-height: 100vh; }
}
