/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-green {
  background: #16a34a;
  color: white;
}

.btn-green:hover:not(:disabled) {
  background: #15803d;
}

.btn-purple {
  background: #9333ea;
  color: white;
}

.btn-purple:hover:not(:disabled) {
  background: #7c3aed;
}

.btn-ghost {
  background: transparent;
  color: #64748b;
}

.btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

.btn-outline {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-red {
  border-color: #fecaca;
  color: #dc2626;
}

.btn-red:hover:not(:disabled) {
  background: #fef2f2;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-description {
  color: #64748b;
  margin-bottom: 1rem;
}

.card-content {
  padding: 1.5rem;
}

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-input {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  height: 3rem;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
}

.password-toggle:hover {
  color: #6b7280;
}

.eye-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.875rem;
}

.forgot-link:hover {
  color: #1d4ed8;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Auth Pages */
.auth-page {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.auth-logo {
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: #64748b;
}

.auth-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  color: #1d4ed8;
}

.demo-info {
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.75rem;
  border-radius: 8px;
}

/* Password Strength */
.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s;
  border-radius: 2px;
}

.strength-text {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: #6b7280;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 1rem;
  height: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #2563eb;
  border-color: #2563eb;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 0.75rem;
}

.terms-link {
  color: #2563eb;
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Loader */
.loader {
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Dashboard */
.dashboard {
  padding: 2rem 0;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-main {
  flex: 1;
}

.action-form {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.copy-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
}

.copy-btn:hover {
  color: #1d4ed8;
}

.copy-btn-small {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
}

.copy-btn-small:hover {
  color: #374151;
}

.referral-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.referral-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.referral-code-box {
  background: #dbeafe;
  padding: 0.75rem;
  border-radius: 8px;
}

.referral-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.referral-code-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.referral-code-display code {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e3a8a;
}

.badge {
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.investments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.investment-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.investment-item:hover {
  border-color: #cbd5e1;
}

.investment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.investment-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.investment-plan {
  font-weight: 600;
  color: #1e293b;
}

.investment-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-active {
  background: #dbeafe;
  color: #1e40af;
}

.status-completed {
  background: #f1f5f9;
  color: #475569;
}

.investment-return {
  text-align: right;
}

.return-label {
  font-size: 0.875rem;
  color: #64748b;
}

.return-value {
  font-weight: 600;
  color: #16a34a;
}

.investment-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  font-size: 0.875rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  color: #64748b;
  margin-bottom: 0.125rem;
}

.detail-value {
  font-weight: 600;
}

.investment-progress {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.progress-label {
  font-size: 0.875rem;
  color: #64748b;
}

.progress-percentage {
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 4px;
  transition: width 0.3s;
}

.no-investments {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

/* Terms Page */
.terms-page {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.terms-content {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.terms-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.terms-updated {
  text-align: center;
  color: #64748b;
  margin-bottom: 2rem;
}

.terms-section {
  margin-bottom: 2rem;
}

.terms-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

.terms-section p {
  color: #4b5563;
  line-height: 1.6;
}

.terms-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.terms-footer p {
  margin-bottom: 1.5rem;
  color: #6b7280;
}

/* Responsive Design for Components */
@media (min-width: 640px) {
  .investment-details {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .dashboard-content {
    grid-template-columns: 1fr 2fr;
  }
}
