/* --- General & Variables --- */
:root {
  --primary-color: #007bff;
  --success-color: #28a745;
  --error-color: #dc3545;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --bg-input: rgba(0, 0, 0, 0.2);
  --border-color: rgba(255, 255, 255, 0.2);
  --card-bg: rgba(30, 30, 40, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(45deg, #1d2b64, #f8cdda);
  color: var(--text-color);
  overflow: hidden;
}

/* --- Main Container & Card Structure --- */
.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.card {
  width: 380px;
  padding: 2.5rem;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  animation: fadeIn 0.8s ease-out;
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 70px;
  margin-bottom: 1rem;
}

h2 {
  font-weight: 500;
  font-size: 1.75rem;
}

/* --- Flip Card Animation --- */
.flip-card {
  perspective: 1500px;
  width: 380px;
  height: 480px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card-inner.is-flipped {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}


/* --- Form Elements --- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: -0.5rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  right: 15px;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-align: left; /* For LTR input like numbers */
  direction: ltr;
}

.input::placeholder {
  color: var(--text-muted);
  text-align: right;
  direction: rtl;
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background-color: #1e7e34;
  transform: translateY(-2px);
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
}

.info-text {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
}
.info-text b {
  font-weight: 700;
  color: #fff;
}


/* --- Utility & Helper Classes --- */
.row { display: flex; align-items: center; gap: 0.5rem; }
.between { justify-content: space-between; }
.small { font-size: 0.8rem; }
.muted { color: var(--text-muted); }

.link {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.link:hover:not(:disabled) {
  text-decoration: underline;
}

.alert {
  width: 380px;
  padding: 1rem;
  margin-top: -1rem;
  border-radius: 8px;
  background-color: rgba(220, 53, 69, 0.9);
  color: white;
  text-align: center;
  font-size: 0.9rem;
  animation: fadeIn 0.5s;
}

.hidden {
  display: none;
}

/* ... (at the end of login.css) ... */

/* --- Signup Section --- */
.signup-section {
  text-align: center;
  margin-top: 1rem; /* Adjust spacing from the card */
  padding: 1rem;
  width: 380px;
  background: rgba(0, 0, 0, 0.2); /* A subtle background to group the links */
  border-radius: 12px;
  animation: fadeIn 1s ease-out 0.5s; /* Delay animation */
  animation-fill-mode: backwards;
}

.signup-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.signup-options {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.signup-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.signup-link:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
