/* Auth Pages (Login/Signup) Styles */

/* Toast Notifications */
.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 400px;
  padding: 16px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-notification.toast-success {
  border-left: 4px solid #10b981;
}

.toast-notification.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-notification.toast-error .toast-icon {
  color: #ef4444;
}

.toast-notification.toast-success .toast-icon {
  color: #10b981;
}

.toast-notification.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-content {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-gray);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: #f5f5f5;
  color: var(--text-dark);
}

/* Inline Field Errors */
.field-error {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #ef4444;
  line-height: 1.4;
}

.form-input.input-error {
  border-color: #ef4444;
}

.form-input.input-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

/* Header */
.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  background: var(--white);
}

.auth-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.auth-logo svg {
  height: 28px;
}

.auth-header-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.auth-header-link a {
  color: var(--primary-green);
  text-decoration: none;
  font-weight: 600;
}

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

/* Main Content */
.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8rem 2rem 2rem;
  background: var(--white);
}

.auth-main.hidden {
  display: none;
}

.auth-container {
  width: 100%;
  max-width: 520px;
}

.auth-container-narrow {
  max-width: 440px;
}

/* Title */
.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.3;
}

.auth-title-small {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.auth-title span {
  color: var(--primary-green);
}

/* Role Selection */
.role-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.role-card:hover {
  border-color: #bbb;
  background: #fafafa;
}

.role-card.selected {
  border-color: var(--primary-green);
  background: #f0f7e6;
}

.role-card.selected .role-radio {
  border-color: var(--primary-green);
  background: var(--primary-green);
}

.role-card.selected .role-radio::after {
  opacity: 1;
}

.role-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

.role-icon {
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.role-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
}

.role-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--white);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.role-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

/* Buttons */
.auth-btn-primary {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 1rem;
  padding: 0.875rem 1.5rem;
  background: var(--primary-green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-btn-primary:hover:not(:disabled) {
  background: var(--dark-green);
}

.auth-btn-primary:disabled {
  background: #e5e5e5;
  color: #999;
  cursor: not-allowed;
}

.auth-btn-full {
  max-width: 100%;
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  color: var(--text-gray);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 0.7rem;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: var(--text-dark);
}

.back-btn svg {
  stroke-width: 2.5;
}

/* Social Signup Buttons */
.social-signup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.social-btn:hover {
  background: #f5f5f5;
}

.social-btn-apple {
  color: var(--text-dark);
}

.social-btn-google {
  color: var(--text-dark);
}

/* Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

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

.auth-divider span {
  position: relative;
  background: var(--white);
  padding: 0 1rem;
  color: var(--text-gray);
  font-size: 0.85rem;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.1);
}

.form-input::placeholder {
  color: #999;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  padding: 0;
}

.password-toggle:hover {
  color: var(--text-dark);
}

.password-toggle .hidden {
  display: none;
}

/* Checkbox Styles */
.form-checkbox-group {
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
}

.checkbox-label input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 0.1rem;
}

.checkbox-label input[type='checkbox']:checked + .checkmark {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.checkbox-label input[type='checkbox']:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
  border-color: var(--primary-green);
}

.checkbox-text {
  font-size: 0.85rem;
  color: var(--text-gray);
  line-height: 1.5;
}

.checkbox-text a {
  color: var(--primary-green);
  text-decoration: underline;
}

.checkbox-text a:hover {
  color: var(--dark-green);
}

/* Footer Text */
.auth-footer-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-top: 1.5rem;
}

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

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

/* Split Layout (Login Page) */
.auth-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--white);
}

.auth-split-left {
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
  overflow-y: auto;
}

.auth-split-right {
  position: relative;
  overflow: hidden;
}

.auth-split-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.auth-split-header-link {
  font-size: 0.9rem;
  color: var(--text-dark);
}

.auth-split-header-link a {
  color: var(--primary-green);
  text-decoration: none;
  font-weight: 600;
}

.auth-split-header-link a:hover {
  text-decoration: underline;
}

.auth-split-content {
  flex: 1;
  display: flex;
  align-items: center;
}

.auth-split-form-wrapper {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-split-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.auth-split-subtitle {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin-bottom: 2rem;
}

.auth-split-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.auth-split-image-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.auth-split-image {
  width: 75%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: var(--primary-green);
  text-decoration: none;
  margin-top: 0.5rem;
  font-weight: 500;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

/* Social Login Buttons */
.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Code Input (Forgot Password Step 2) */
.auth-code-subtitle {
  font-size: 0.95rem;
  color: var(--text-gray);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-code-subtitle span {
  color: var(--text-dark);
  font-weight: 500;
}

.code-input-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.code-input {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-main);
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.1);
}

.auth-code-resend {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-code-resend p {
  font-size: 0.9rem;
  color: var(--text-gray);
}

.auth-code-resend a {
  color: var(--primary-green);
  text-decoration: none;
  font-weight: 600;
}

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

.resend-timer {
  margin-top: 0.5rem;
}

.resend-timer span {
  font-weight: 600;
  color: var(--text-dark);
}

/* Signup Decorative Corner Images */
.signup-decorative-images {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.signup-decorative-left,
.signup-decorative-right {
  position: absolute;
  bottom: 0;
}

.signup-decorative-left {
  left: 0;
}

.signup-decorative-right {
  right: 0;
}

.signup-decorative-left img,
.signup-decorative-right img {
  height: auto;
  max-width: 300px;
  display: block;
}

/* Welcome Modal */
.welcome-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.welcome-modal-overlay.welcome-modal-overlay-visible {
  opacity: 1;
}

.welcome-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-modal-overlay-visible .welcome-modal {
  transform: scale(1);
}

.welcome-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary-green);
}

.welcome-modal-icon svg {
  width: 64px;
  height: 64px;
}

.welcome-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.welcome-modal-message {
  font-size: 1rem;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.welcome-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.welcome-modal-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;
  font-family: var(--font-main);
}

.welcome-modal-btn-primary {
  background: var(--primary-green);
  color: var(--white);
}

.welcome-modal-btn-primary:hover {
  background: var(--dark-green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 35, 0.3);
}

.welcome-modal-btn-primary:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .auth-split-container {
    grid-template-columns: 1fr;
  }

  .auth-split-right {
    display: none;
  }

  .auth-split-left {
    padding: 1.5rem;
  }

  .auth-split-header {
    margin-bottom: 2rem;
  }

  .auth-split-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 768px) {
  .auth-header {
    padding: 1rem;
  }

  .auth-header-link span {
    display: none;
  }

  .auth-main {
    padding: 5rem 1rem 1rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .role-selection {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-btn-primary {
    max-width: 100%;
  }

  .auth-split-left {
    padding: 1rem;
  }

  .auth-split-title {
    font-size: 1.5rem;
  }

  .code-input {
    width: 40px;
    height: 50px;
    font-size: 1.25rem;
  }

  .code-input-container {
    gap: 0.5rem;
  }

  .signup-decorative-left img,
  .signup-decorative-right img {
    max-width: 200px;
  }

  /* Toast responsive */
  .toast-notification {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  /* Welcome modal responsive */
  .welcome-modal {
    padding: 2rem 1.5rem;
    max-width: 90%;
  }

  .welcome-modal-title {
    font-size: 1.5rem;
  }

  .welcome-modal-message {
    font-size: 0.95rem;
  }

  .welcome-modal-icon svg {
    width: 48px;
    height: 48px;
  }
}
