/* --- Biến màu và Font --- */
:root {
  /* Các biến màu này đã được chuyển vào shared-layout.css */
  /* Giữ lại các biến dành riêng cho trang đăng nhập nếu cần */
  --login-bg-color: #f4f7f6;
  --login-card-bg: rgba(255, 255, 255, 0.85);
  --login-primary-green: #4a7c59;
  --login-secondary-green: #82a08c;
  --login-accent-gold: #c5a67c;
  --login-text-dark: #3a3d3b;
  --login-text-light: #7a7e7c;
  --login-border-color: rgba(74, 124, 89, 0.2);
  --login-shadow-color: rgba(74, 124, 89, 0.1);
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--login-bg-color);
  margin: 0;
  overflow: hidden;
  color: var(--login-text-dark);
}

/* --- Container chính --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

.wellness-card {
  width: 100%;
  max-width: 420px;
  background: var(--login-card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 40px var(--login-shadow-color);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.organic-border {
  position: absolute;
  inset: 0; /* Viết tắt cho top, right, bottom, left */
  border-radius: 24px;
  padding: 2px; /* Độ dày của viền */
  opacity: 0.3;
  pointer-events: none;
  /* Sử dụng pseudo-element để tạo viền gradient, tương thích tốt hơn */
  background: linear-gradient(145deg, var(--login-secondary-green), var(--login-accent-gold));
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

/* --- Header --- */
.mindful-header {
  text-align: center;
  margin-bottom: 30px;
}

.zen-logo {
  display: inline-block;
  position: relative;
  color: var(--login-primary-green);
  margin-bottom: 10px;
}

.zen-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--login-primary-green) 0%, transparent 70%);
  opacity: 0.15;
  border-radius: 50%;
  z-index: -1;
}

.mindful-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 5px 0;
  color: var(--login-text-dark);
}

.mindful-header p {
  margin: 0;
  color: var(--login-text-dark); /* Đổi màu cho đậm hơn */
  font-size: 1.2rem; /* 0.95rem * 1.5 */
  /* font-weight: bold; */
  margin-top: 10px; /* Thêm khoảng cách với tiêu đề trên */
}

/* --- Form --- */
.harmony-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.organic-field {
  position: relative;
}

.organic-field input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--login-border-color);
  border-radius: 12px;
  background-color: transparent;
  font-size: 1rem;
  color: var(--login-text-dark);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.organic-field label {
  position: absolute;
  top: 14px;
  left: 18px;
  color: var(--login-text-light);
  pointer-events: none;
  transition: all 0.3s ease;
}

.organic-field input:not(:placeholder-shown) {
  border-color: var(--login-primary-green);
  background-color: rgba(255, 255, 255, 0.5);
}

.organic-field input:focus {
  border-color: var(--login-primary-green);
  background-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--login-shadow-color);
}

.organic-field input:focus + label,
.organic-field input:not(:placeholder-shown) + label {
  top: -10px;
  left: 12px;
  font-size: 0.8rem;
  color: var(--login-primary-green);
  background-color: var(--login-bg-color);
  padding: 0 6px;
  border-radius: 4px;
}

.gentle-error {
  font-size: 0.8rem;
  color: var(--danger-color, #d9534f); /* Dùng fallback */
  padding-left: 15px;
  margin-top: 4px;
  min-height: 1.2em;
  /* Thêm hiệu ứng chuyển tiếp */
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gentle-error:not(:empty) {
    /* Hiển thị khi có nội dung */
    opacity: 1;
    transform: translateY(0);
}

/* --- Nút hiển thị mật khẩu --- */
.nature-toggle {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--login-secondary-green);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nature-toggle .eye-hidden {
  display: none;
}

.nature-toggle.toggled .eye-visible {
  display: none;
}

.nature-toggle.toggled .eye-hidden {
  display: block;
}

/* --- Tùy chọn (Ghi nhớ, Quên MK) --- */
.mindful-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.zen-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--login-text-light);
}

.zen-checkbox input {
  display: none;
}

.checkbox-leaf {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--login-secondary-green);
  border-radius: 6px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.checkbox-leaf svg {
  color: white;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.zen-checkbox input:checked + .checkbox-leaf {
  background-color: var(--login-primary-green);
  border-color: var(--login-primary-green);
}

.zen-checkbox input:checked + .checkbox-leaf svg {
  transform: scale(1);
}

.healing-link {
  color: var(--login-primary-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

.healing-link:hover {
  text-decoration: underline;
  color: var(--login-accent-gold);
}

/* --- Nút Đăng nhập --- */
.harmony-button {
  /* width: 100%; */
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--login-primary-green), var(--login-secondary-green));
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3); /* Giữ lại hoặc tạo biến mới */
}

.harmony-button {
    display: flex;
    align-items: center;
    justify-content: center;
}
.harmony-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 124, 89, 0.4); /* Giữ lại hoặc tạo biến mới */
}

.harmony-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3); /* Giữ lại hoặc tạo biến mới */
}

.harmony-button:disabled {
    cursor: not-allowed;
    background: var(--login-secondary-green);
    box-shadow: none;
    transform: none;
}
.button-growth {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.harmony-button:active .button-growth {
  opacity: 1;
}

.growing-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: grow 0.7s ease-out forwards;
}

@keyframes grow {
  from { width: 0; height: 0; opacity: 1; }
  to { width: 200px; height: 200px; opacity: 0; }
}

.growing-circle.circle-2 { animation-delay: 0.1s; }
.growing-circle.circle-3 { animation-delay: 0.2s; }

/* --- Hiệu ứng Loading cho nút --- */
.button-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.harmony-button.loading .button-text {
    display: none;
}
.harmony-button.loading .button-spinner {
    display: block;
}

/* --- Thông báo trạng thái --- */
.status-message {
  margin-top: 15px;
  text-align: center;
  color: var(--danger-color, #d9534f);
  font-weight: 500;
  min-height: 1.2em;
  /* Thêm hiệu ứng chuyển tiếp */
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.status-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* --- Giao diện thành công --- */
.harmony-success {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--login-card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 10;
}

.harmony-success.visible {
  opacity: 1;
  pointer-events: all;
}

.success-mandala {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
}

.mandala-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--success-color, #5cb85c);
  opacity: 0;
  animation: mandala-pulse 1.5s ease-out infinite;
}
.ring-2 { animation-delay: 0.5s; }
.ring-3 { animation-delay: 1s; }

@keyframes mandala-pulse {
  from { width: 0; height: 0; opacity: 1; }
  to { width: 100%; height: 100%; opacity: 0; }
}

.mandala-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  background-color: var(--success-color, #5cb85c);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.harmony-success h3 {
  font-size: 1.5rem;
  color: var(--login-text-dark);
  margin: 0 0 5px 0;
}

.harmony-success p {
  color: var(--login-text-light);
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .wellness-card {
    padding: 30px 25px;
  }
  .mindful-header h1 {
    font-size: 1.5rem;
  }
}

/* --- Ripple Effect --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none; /* Ngăn ripple bắt sự kiện click */
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Social Login Divider & Buttons --- */
.balance-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    color: var(--login-secondary-green);
}

.divider-branch {
    flex-grow: 1;
    height: 1px;
    background-color: var(--login-border-color);
}

.natural-social {
    display: flex;
    justify-content: center;
}

.earth-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--login-border-color);
    border-radius: 12px;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--login-text-dark);
    transition: all 0.3s ease;
}

.earth-social:hover {
    border-color: var(--login-primary-green);
    box-shadow: 0 4px 15px var(--login-shadow-color);
    transform: translateY(-2px);
}

.earth-social svg {
    width: 20px;
    height: 20px;
}
