/* ============================================
   MODERN AUTHENTICATION STYLES
   Responsive, Clean, Professional
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary-color: #006aff;
  --primary-hover: #0056cf;
  --primary-light: #e6f0ff;
  --error-color: #d32f2f;
  --error-bg: #ffebee;
  --success-color: #2e7d32;
  --success-bg: #e8f5e9;
  --text-primary: #2a2a33;
  --text-secondary: #6b6b7b;
  --text-muted: #9e9e9e;
  --border-color: #d1d1d5;
  --border-focus: #006aff;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.signin-body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', Roboto, sans-serif;
  min-height: 100svh;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */
.signin-wrapper {
  display: flex;
  min-height: 100svh;
  width: 100%;
}

/* Left Side (Form) */
.signin-left {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-white);
}

/* Right Side (Image) */
.signin-right {
  flex: 1.2;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.signin-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
  z-index: 1;
}

.signin-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.signin-right:hover img {
  transform: scale(1.02);
}

/* --- Logo --- */
.header-logo {
  margin-bottom: 32px;
}

.header-logo img {
  width: 140px;
  height: auto;
}

/* --- Typography --- */
.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* --- Form Elements --- */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: var(--transition);
  background: var(--bg-white);
  color: var(--text-primary);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input:hover {
  border-color: #b0b0b5;
}

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

.input-group input:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
}

/* --- Buttons --- */
.primary-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.primary-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Social Buttons */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-btn {
  width: 100%;
  background: var(--bg-white);
  border: 1.5px solid var(--border-color);
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  font-size: 15px;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.social-btn:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.social-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.social-btn i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.social-btn .fa-google {
  color: #db4437;
}

.social-btn .fa-apple {
  color: #000;
  font-size: 20px;
}

.social-btn .fa-facebook {
  color: #1877f2;
}

/* --- Divider --- */
.divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: var(--bg-white);
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Links --- */
.text-center {
  text-align: center;
  margin-top: 16px;
}

.link-small {
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

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

/* --- Form Message --- */
.form-message {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.4;
  display: none;
}

.form-message.error {
  background: var(--error-bg);
  color: var(--error-color);
  border: 1px solid rgba(211, 47, 47, 0.2);
  display: block;
}

.form-message.success {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(46, 125, 50, 0.2);
  display: block;
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.social-btn .spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary-color);
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Password Strength Indicator --- */
.password-strength {
  margin-top: 8px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-bar.weak {
  width: 33%;
  background: var(--error-color);
}

.password-strength-bar.medium {
  width: 66%;
  background: #ff9800;
}

.password-strength-bar.strong {
  width: 100%;
  background: var(--success-color);
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 20px;
  transition: var(--transition);
}

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

/* --- Footer Links --- */
.auth-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.auth-footer p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auth-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* --- Responsive Design --- */

/* Tablet */
@media (max-width: 1024px) {
  .signin-left {
    padding: 40px 32px;
  }
  
  .auth-title {
    font-size: 26px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .signin-wrapper {
    flex-direction: column;
  }
  
  .signin-right {
    display: none;
  }
  
  .signin-left {
    max-width: 100%;
    padding: 32px 24px;
    min-height: 100svh;
    justify-content: flex-start;
    padding-top: 40px;
  }
  
  .header-logo {
    margin-bottom: 24px;
  }
  
  .header-logo img {
    width: 120px;
  }
  
  .auth-title {
    font-size: 24px;
  }
  
  .auth-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }
  
  .input-group {
    margin-bottom: 16px;
  }
  
  .input-group input {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .primary-btn,
  .social-btn {
    padding: 12px 16px;
  }
  
  .divider {
    margin: 20px 0;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .signin-left {
    padding: 24px 20px;
  }
  
  .auth-title {
    font-size: 22px;
  }
  
  .social-btn {
    font-size: 14px;
  }
}

/* Height adjustments */
@media (max-height: 700px) and (min-width: 769px) {
  .signin-left {
    justify-content: flex-start;
    padding-top: 32px;
    padding-bottom: 32px;
    overflow-y: auto;
  }
}

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

/* Focus visible for keyboard navigation */
.primary-btn:focus-visible,
.social-btn:focus-visible,
.input-group input:focus-visible,
.link-small:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000;
    --text-secondary: #000;
  }
}
