/**
 * CareerNest Login Page Styles
 * Minimal & Clean Design
 */

/* ========================================
   BASE STYLES & LAYOUT
   ======================================== */

.cn-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.cn-auth-container {
  width: 100%;
  max-width: 450px;
  position: relative;
  margin-inline: auto;
}

/* ========================================
   MAIN AUTH CARD
   ======================================== */

.cn-auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  padding: 3rem 2.5rem;
  position: relative;
}

/* Remove unused elements */
.cn-auth-overlay,
.cn-auth-background,
.cn-auth-tabs {
  display: none !important;
}

/* ========================================
   FORMS CONTAINER
   ======================================== */

.cn-auth-forms {
  position: relative;
}

.cn-auth-form {
  opacity: 1;
  max-height: none;
  overflow: visible;
}

.cn-form-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #2d3748;
  text-align: center;
}

.cn-form-subtitle {
  text-align: center;
  color: #718096;
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
}

/* ========================================
   SOCIAL LOGIN BUTTONS
   ======================================== */

.cn-social-login {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cn-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #4a5568;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cn-social-btn:hover {
  border-color: var(--cn-primary-btn, #cbd5e0);
  background: #f7fafc;
  color: #4a5568;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--cn-primary-btn-rgb, 0, 0, 0), 0.08);
}

.cn-social-btn svg {
  flex-shrink: 0;
}

/* ========================================
   FORM DIVIDER
   ======================================== */

.cn-form-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #a0aec0;
  font-size: 0.875rem;
}

.cn-form-divider::before,
.cn-form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.cn-form-divider span {
  padding: 0 1rem;
}

/* ========================================
   FORM GROUPS & INPUTS
   ======================================== */

.cn-form-group {
  margin-bottom: 1.25rem;
}

.cn-field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #2d3748;
  font-size: 0.875rem;
}

.cn-input-wrapper {
  position: relative;
}

.cn-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  pointer-events: none;
}

.cn-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: #f7fafc;
  box-sizing: border-box;
  color: #2d3748;
}

.cn-input:focus {
  outline: none;
  border-color: #ff8200;
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.08);
}

.cn-input::placeholder {
  color: #a0aec0;
}

.cn-input.error {
  border-color: #f56565;
  background: #fff5f5;
}

.cn-input.error:focus {
  box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

/* Password Toggle */
.cn-password-wrapper {
  position: relative;
}

.cn-password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.cn-password-toggle:hover {
  color: #ff8200;
}

/* Field Errors */
.cn-field-error {
  display: block;
  color: #f56565;
  font-size: 0.8rem;
  margin-top: 0.375rem;
  min-height: 1.2em;
}

/* ========================================
   CHECKBOX STYLES
   ======================================== */

.cn-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.cn-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cn-checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked ~ .cn-checkbox-custom {
  border-color: #ff8200;
  background: #ff8200;
}

input[type="checkbox"]:checked ~ .cn-checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

.cn-checkbox-text {
  color: #4a5568;
  font-size: 0.875rem;
}

/* ========================================
   FORM OPTIONS (Remember Me, Forgot Password)
   ======================================== */

.cn-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.cn-forgot-link {
  color: #ff8200;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cn-forgot-link:hover {
  color: #e67300;
  text-decoration: underline;
}

/* ========================================
   BUTTONS
   ======================================== */

.cn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.cn-btn-primary {
  background: #ff8200;
  color: white;
}

.cn-btn-primary:hover:not(:disabled) {
  background: #e67300;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 130, 0, 0.25);
}

.cn-btn-outline {
  background: transparent;
  border: 2px solid #e2e8f0;
  color: #4a5568;
}

.cn-btn-outline:hover:not(:disabled) {
  background: #f7fafc;
  border-color: #ff8200;
  color: #ff8200;
}

.cn-btn-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.cn-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button Loading State */
.cn-btn-submit.loading .cn-btn-text {
  display: none;
}

.cn-btn-submit.loading .cn-btn-loader {
  display: block !important;
}

.cn-spinner {
  animation: cn-spin 1s linear infinite;
}

@keyframes cn-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   FORM MESSAGES
   ======================================== */

.cn-form-messages {
  margin-bottom: 1rem;
  min-height: 1px;
}

.cn-form-message {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: cn-slide-in 0.3s ease-out;
}

@keyframes cn-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cn-form-message-error {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
}

.cn-form-message-success {
  background: #f0fff4;
  border: 1px solid #68d391;
  color: #22543d;
}

.cn-form-message-icon {
  flex-shrink: 0;
}

/* ========================================
   REGISTRATION LINKS
   ======================================== */

.cn-register-links {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.cn-register-text {
  color: #718096;
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.cn-register-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cn-register-buttons .cn-btn {
  width: 100%;
  justify-content: center;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 480px) {
  .cn-auth-page {
    padding: 1rem 0.5rem;
  }

  .cn-auth-card {
    padding: 2rem 1.5rem;
    border-radius: 8px;
  }

  .cn-form-title {
    font-size: 1.5rem;
  }

  .cn-input {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.9rem;
  }

  .cn-input-icon {
    left: 0.75rem;
    width: 18px;
    height: 18px;
  }

  .cn-btn-submit {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .cn-social-login {
    flex-direction: column;
  }

  .cn-form-options {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.cn-btn:focus-visible,
.cn-input:focus-visible,
.cn-password-toggle:focus-visible,
.cn-social-btn:focus-visible {
  outline: 2px solid #ff8200;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── OAuth notice banner (rendered above the login form) ────────── */
.cn-auth-notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.cn-auth-notice--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.cn-auth-notice--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.cn-auth-notice strong {
  font-weight: 600;
  margin-right: 4px;
}

/* ── OAuth account-type chooser ──────────────────────────────────── */
/* Widen the container on the chooser page only — two cards need the room.
   Other auth pages (login, forgot-password, reset) keep the 450px column. */
.cn-oauth-chooser-page .cn-auth-container {
  max-width: 850px;
}

.cn-oauth-chooser-page .cn-auth-card {
  max-width: 100%;
}

.cn-oauth-chooser-card-wrap .cn-form-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.cn-oauth-chooser-card-wrap .cn-form-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 2rem;
}

.cn-oauth-chooser-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.cn-oauth-chooser-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin: 0;
}

.cn-oauth-chooser-card:hover {
  border-color: var(--cn-primary-btn, #FF8200);
  box-shadow: 0 4px 16px rgba(var(--cn-primary-btn-rgb, 255, 130, 0), 0.12);
  transform: translateY(-2px);
}

.cn-oauth-chooser-card-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}

.cn-oauth-chooser-card-title {
  font-size: 1.25rem;
  margin: 0 0 4px 0;
  color: #1a202c;
}

.cn-oauth-chooser-card-subtitle {
  margin: 0 0 16px 0;
  color: #718096;
  font-size: 0.875rem;
}

.cn-oauth-chooser-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  font-size: 0.92rem;
  color: #4a5568;
  text-align: left;
  width: 100%;
}

.cn-oauth-chooser-card-features li {
  padding: 6px 0 6px 20px;
  position: relative;
}

.cn-oauth-chooser-card-features li::before {
  content: "✓";
  color: var(--cn-primary-btn, #FF8200);
  font-weight: 700;
  position: absolute;
  left: 0;
}

.cn-oauth-chooser-card-perk {
  font-size: 0.875rem;
  color: var(--cn-primary-btn, #FF8200);
  font-weight: 600;
  margin: 0 0 16px 0;
}

.cn-oauth-chooser-card-warning {
  font-size: 0.875rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 0 0 16px 0;
  text-align: left;
}

.cn-oauth-chooser-card-btn {
  width: 100%;
  margin-top: auto;
  font-weight: 600;
}

.cn-oauth-chooser-identity {
  text-align: center;
  font-size: 0.92rem;
  color: #4a5568;
  margin: 24px 0 4px 0;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.cn-oauth-chooser-identity-alt {
  text-align: center;
  font-size: 0.85rem;
  color: #718096;
  margin: 0;
}

.cn-oauth-chooser-identity-alt a {
  color: var(--cn-primary-btn, #FF8200);
  text-decoration: none;
}

.cn-oauth-chooser-identity-alt a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .cn-oauth-chooser-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cn-oauth-chooser-card {
    padding: 24px 18px;
  }
  .cn-oauth-chooser-card-icon {
    font-size: 40px;
  }
}
