/* ===========================
   LOGIN PAGE STYLES
   =========================== */

/* Variables (matching main site) */
:root {
  --mint: #a8e6cf;
  --dark-green: #476d5f;
  --dark-grey: #666d6b;
  --light-grey: #ececec;
  --bg: #ffffff;
  --error-red: #d32f2f;
}

/* Login page layout */
body.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background-color: var(--bg);
}

/* Main container (takes remaining space, centers content) */
.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

/* Login card */
.login-card {
  background: white;
  border: 1px solid var(--light-grey);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  font-family: "Codec Pro", "Nunito", sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--dark-grey);
  margin: 0 0 8px;
  text-align: center;
}

.login-subtitle {
  font-size: 16px;
  color: var(--dark-grey);
  margin: 0 0 32px;
  text-align: center;
  opacity: 0.8;
}

/* Form fields */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-grey);
}

.form-field input {
  padding: 12px 16px;
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: white;
}

.form-field input:focus {
  outline: none;
  border-color: var(--dark-green);
  box-shadow: 0 0 0 3px rgba(168, 230, 207, 0.3);
}

.form-field input::placeholder {
  color: #999;
}

/* Input with toggle (password) */
.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle input {
  padding-right: 48px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--dark-grey);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--dark-green);
}

.password-toggle:focus {
  outline: 2px solid var(--mint);
  border-radius: 4px;
}

/* Login options (remember me + forgot password) */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -8px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--dark-green);
}

.form-checkbox label {
  font-size: 14px;
  color: var(--dark-grey);
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}

.forgot-link {
  font-size: 14px;
  color: var(--dark-green);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.forgot-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Buttons */
.btn {
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background-color: var(--mint);
  color: var(--dark-green);
  border: 2px solid var(--dark-green);
}

.btn-primary:hover {
  background-color: #92ddb8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-social {
  background-color: white;
  color: var(--dark-grey);
  border: 1px solid var(--light-grey);
  width: 100%;
}

.btn-social:hover {
  background-color: #f9f9f9;
  border-color: var(--dark-grey);
}

.btn-social svg {
  flex-shrink: 0;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
  color: var(--dark-grey);
  opacity: 0.6;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--light-grey);
}

.divider span {
  padding: 0 16px;
  font-size: 14px;
}

/* Login footer (signup link) */
.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--dark-grey);
}

.login-footer a {
  color: var(--dark-green);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Country selector */
.country-selector {
  margin-top: 32px;
  position: relative;
}

.country-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--dark-grey);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.country-button:hover {
  background-color: rgba(168, 230, 207, 0.2);
}

.country-button svg {
  transition: transform 0.2s;
}

.country-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.country-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: white;
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  display: none;
  overflow: hidden;
}

.country-dropdown.open {
  display: block;
}

.country-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: none;
  text-align: left;
  font-size: 14px;
  color: var(--dark-grey);
  cursor: pointer;
  transition: background-color 0.2s;
}

.country-option:hover {
  background-color: var(--mint);
}

/* Error messages */
.error-message {
  color: var(--error-red);
  font-size: 14px;
  margin-top: 4px;
  display: none;
}

.error-message.visible {
  display: block;
}

.form-field.error input {
  border-color: var(--error-red);
}

.form-field.error input:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

/* Loading state */
.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid var(--dark-green);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 600px) {
  .login-card {
    padding: 32px 24px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .login-subtitle {
    font-size: 14px;
  }

  .login-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .forgot-link {
    margin-left: 26px;
  }
}

@media (max-width: 400px) {
  .login-card {
    padding: 24px 20px;
  }

  .login-card h1 {
    font-size: 24px;
  }

  .btn {
    font-size: 14px;
    padding: 12px 20px;
  }

  .btn-social {
    font-size: 14px;
  }
}
