/* ============================================
   WebPay - Base CSS
   Variables, reset, typography, layout
   ============================================ */

:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-bg: #f9fafb;
  --color-bg-card: #ffffff;
  --color-border: #e5e7eb;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-shadow-lg: rgba(0, 0, 0, 0.1);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;

  /* Layout */
  --max-width: 1200px;
  --header-height: 60px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout */
.main-content {
  flex: 1;
  padding: var(--space-xl) var(--space-md);
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   Header
   ============================================ */
.app-header {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}
.app-logo__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.app-nav a {
  color: var(--color-text);
  font-weight: 500;
}

.app-nav a:hover {
  color: var(--color-primary);
}

.app-nav .btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  font-weight: 500;
}

.app-nav .btn-primary {
  background: var(--color-primary);
  color: white;
}

.app-nav .btn-primary:hover {
  background: var(--color-primary-hover);
  color: white;
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ============================================
   Components: Cards, Buttons, Forms
   ============================================ */
.card {
  background: var(--color-bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 1px 3px var(--color-shadow);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: inherit;
  transition: border-color 0.2s;
}

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

/* ============================================
   Page structure
   ============================================ */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   Toast notification
   ============================================ */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-text);
  color: white;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  box-shadow: 0 4px 12px var(--color-shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }

/* ============================================
   Auth pages - full background (login, register)
   ============================================ */
body.auth-page {
  display: block;
  background: #1e40af;
}

.auth-page-bg {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-xl);
  overflow: hidden;
}

.auth-page-bg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.auth-page-bg .auth-form-wrap--left {
  position: relative;
  z-index: 1;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.auth-form-wrap--left {
  margin-left: 8%;
  margin-right: auto;
}

.auth-form__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
  margin-bottom: var(--space-2xl);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.auth-form-wrap .auth-form__title {
  color: #fff;
}

.auth-form {
  width: 100%;
  margin-bottom: var(--space-2xl);
}

.auth-form .form-group {
  margin-bottom: var(--space-lg);
}

.auth-form .form-label {
  color: #fff;
}

.auth-input {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.5);
}

.auth-input:focus {
  background: #fff;
  border-color: var(--color-primary);
}

.auth-form__submit {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--border-radius);
  margin-top: var(--space-sm);
}

.auth-form__register {
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.9);
}

.auth-form__register a {
  color: #fff;
  font-weight: 600;
}

.auth-form__register a:hover {
  text-decoration: underline;
}

.auth-footer-links {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
}

.auth-footer-links a {
  color: rgba(255,255,255,0.9);
}

.auth-footer-links a:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .auth-form-wrap--left {
    margin-left: auto;
    margin-right: auto;
  }
}
