/* Auth pages styling to match the main Ravani theme.
   Reuses CSS variables and journal styles from style.css. */

/* Reset to ensure proper centering */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.auth-body {
  background-color: var(--bg-main, #f5efdc);
  color: var(--text-primary, #3a2b20);
  font-family: var(--font-primary, 'EB Garamond', serif);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.auth-card {
  background-color: var(--bg-input-area, #f0e9d9);
  border: 2px solid var(--border-primary, #c8b89a);
  border-radius: 10px;
  box-shadow: var(--shadow-journal, 0 4px 12px rgba(0,0,0,0.1));
  width: 100%;
  max-width: 460px;
  padding: 22px 22px 26px 22px;
  box-sizing: border-box;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  gap: 8px;
}

.auth-brand .auth-logo {
  height: 48px;
  width: auto;
  display: block;
  margin: 0 0 5px 0;
}

.auth-brand .brand-title {
  font-family: var(--font-decorative, 'Cinzel Decorative', serif);
  color: var(--text-primary, #3a2b20);
  letter-spacing: 0.5px;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Form structure */
.auth-content {
  margin-top: 6px;
}

.auth-desc {
  color: var(--text-secondary, #5c4b3f);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 14px;
}

/* Ensure inputs look like journal form inputs */
.auth-card form input[type="text"],
.auth-card form input[type="email"],
.auth-card form input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  background-color: var(--input-bg, #fff);
  border: 2px solid var(--border-primary, #c8b89a);
  border-radius: 8px;
  font-family: var(--font-primary, 'EB Garamond', serif);
  font-size: 16px;
  color: var(--text-primary, #3a2b20);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.auth-card form input[type="text"]:focus,
.auth-card form input[type="email"]:focus,
.auth-card form input[type="password"]:focus {
  outline: none;
  border-color: var(--border-focus, #8a5c43);
  box-shadow: 0 0 0 3px rgba(138, 92, 67, 0.1);
}

.auth-errors {
  color: #d73a49;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Reuse journal spacing */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-family: var(--font-decorative, 'Cinzel Decorative', serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #3a2b20);
  margin-bottom: 6px;
}

/* Buttons (reuse theme colors) */
.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.auth-actions .left,
.auth-actions .right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-primary, 'EB Garamond', serif);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.auth-btn-primary {
  background-color: var(--button-bg, #7a5c43);
  color: var(--button-text, #fdf5e6);
  border-color: var(--button-bg, #7a5c43);
}
.auth-btn-primary:hover {
  background-color: var(--button-hover-bg, #5a3a22);
  border-color: var(--button-hover-bg, #5a3a22);
  transform: translateY(-1px);
}

.auth-btn-secondary {
  background-color: transparent;
  color: var(--text-primary, #3a2b20);
  border-color: var(--border-primary, #c8b89a);
}
.auth-btn-secondary:hover {
  background-color: var(--border-primary, #c8b89a);
  color: var(--text-primary, #3a2b20);
  transform: translateY(-1px);
}

/* Microsoft button styled like primary but with icon space */
.auth-btn-microsoft {
  background-color: var(--button-bg, #7a5c43);
  color: var(--button-text, #fdf5e6);
  border-color: var(--button-bg, #7a5c43);
  display: flex;                /* span full content width */
  width: 100%;                  /* align with card inner edges */
  box-sizing: border-box;       /* include 2px border in width to prevent spill */
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;           /* consistent size with primary buttons */
  line-height: 1.2;             /* tighten text line height */
  margin: 6px 0 10px 0;         /* vertical spacing, no horizontal margin */
}
.auth-btn-microsoft:hover {
  background-color: var(--button-hover-bg, #5a3a22);
  border-color: var(--button-hover-bg, #5a3a22);
}

/* Links row under forms */
.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 0.95rem;
}

.auth-links a {
  color: var(--text-primary, #3a2b20);
  text-decoration: underline;
  text-decoration-color: rgba(138, 92, 67, 0.5);
}
.auth-links a:hover {
  color: var(--button-hover-bg, #5a3a22);
  text-decoration-color: var(--button-hover-bg, #5a3a22);
}

/* Divider */
.auth-divider {
  margin: 12px 0 8px 0;
  position: relative;
  text-align: center;
  color: var(--text-secondary, #5c4b3f);
  font-size: 0.95rem;
}
.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  border-top: 1px solid var(--border-primary, #c8b89a);
}
.auth-divider span {
  position: relative;
  background-color: var(--bg-input-area, #f0e9d9);
  padding: 0 10px;
}

/* Success/Info messages */
.auth-info {
  background: rgba(138, 92, 67, 0.08);
  border: 1px solid rgba(138, 92, 67, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-primary, #3a2b20);
  font-size: 0.95rem;
}

/* Password requirements validation */
.password-requirements {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  font-size: 0.85rem;
}

.password-requirements .requirement {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--text-secondary, #5c4b3f);
  transition: color 0.2s ease;
}

.password-requirements .requirement .req-icon::before {
  content: "○";
  font-size: 0.7rem;
}

.password-requirements .requirement.valid {
  color: #2e7d32;
}

.password-requirements .requirement.valid .req-icon::before {
  content: "✓";
  font-weight: bold;
}

.password-requirements .requirement.invalid {
  color: #c62828;
}

.password-requirements .requirement.invalid .req-icon::before {
  content: "✗";
  font-weight: bold;
}
