@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --primary-color: #007aff; /* Main brand blue */
  --secondary-color: #f0f0f0; /* Light gray for backgrounds */
  --text-color: #333; /* Dark primary text */
  --light-text: #888; /* Lighter text for descriptions */
  --background-color: #f7f7f7; /* Default page background */
  --white: #fff;
  --border-color: #e0e0e0; /* Light border color */
  --shadow-color: rgba(0, 0, 0, 0.08); /* Subtle shadow */
  --success-color: #28a745; /* Green for discounts/success */
  --error-color: #dc3545; /* Red for errors */
  --disabled-color: #ccc; /* Gray for disabled elements */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Buttons --- */
.primary-btn, .secondary-btn, .login-btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.2s, opacity 0.3s;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}
.primary-btn {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}
.primary-btn:hover {
  background-color: #005bb5;
  border-color: #005bb5;
  transform: translateY(-2px);
}
.secondary-btn {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border-color: var(--border-color);
}
.secondary-btn:hover {
  background-color: #e8e8e8;
  transform: translateY(-2px);
}

/* --- Modals (Common Styles) --- */
.modal, .auth-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}
.modal.visible, .auth-modal.visible {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.modal-content, .auth-modal-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: zoomIn 0.3s;
    transform: scale(0.9);
    transition: transform 0.3s;
}
.modal.visible .modal-content, .auth-modal.visible .auth-modal-content {
  transform: scale(1);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-close-btn, .close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.auth-close-btn:hover, .close-modal-btn:hover {
    color: #333;
}

.auth-modal-content h2, .modal-content h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.auth-modal-content form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.auth-modal-content form .form-row {
    display: flex;
    gap: 15px;
}

.auth-modal-content form button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.auth-modal-content form button:hover {
    background-color: #005bb5;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #606770;
}
.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.auth-error, .auth-success {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: none;
}
.auth-error {
    color: var(--error-color);
    background-color: #fbeae5;
    border: 1px solid var(--error-color);
}
.auth-success {
    color: var(--success-color);
    background-color: #eaf7ea;
    border: 1px solid var(--success-color);
}

.account-modal-content {
    max-width: 600px;
}
.account-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.account-nav-item {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
    color: var(--light-text);
    border-bottom: 3px solid transparent;
}
.account-nav-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.logout-btn {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}
.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}