@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --accent: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  
  --bg-page: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 0 3px rgba(79,70,229,0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
}

body::-webkit-scrollbar {
    width: 6px;
}
body::-webkit-scrollbar-track {
    background: transparent;
}
body::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 6px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

.label, .caps {
    font-weight: 500;
    letter-spacing: 0.05em;
    font-size: 12px;
    text-transform: uppercase;
}

img.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}
img.lazy.loaded {
    opacity: 1;
}
img, video {
    object-fit: cover;
    max-width: 100%;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes float-up {
    0% { transform: translateY(0) scale(1); opacity: 0.05; }
    50% { transform: translateY(-30px) scale(1.05); opacity: 0.08; }
    100% { transform: translateY(0) scale(1); opacity: 0.05; }
}
.blob {
    position: absolute;
    border-radius: 50%;
    background: #FFF;
    animation: float-up 15s infinite ease-in-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-enter {
    animation: page-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.heart-pop {
    animation: heart-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--danger) !important;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-sm);
}

/* Components */
.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-4);
    height: 48px;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 16px;
    gap: var(--space-2);
}
.btn-primary {
    background: linear-gradient(to right, var(--primary), #3730A3);
    color: #FFF;
    box-shadow: var(--shadow-sm);
}
.btn-primary:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-page);
    border-color: var(--text-muted);
}
.btn-sm {
    height: 32px;
    padding: 0 var(--space-3);
    font-size: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    position: relative;
}
.input-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}
.input-control {
    width: 100%;
    padding: 0 var(--space-4);
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}
.input-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    outline: none;
}
.input-control.is-invalid {
    border-color: var(--danger);
}
.input-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.invalid-feedback {
    color: var(--danger);
    font-size: 13px;
    margin-top: -4px;
    display: block;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    top: 36px;
    color: var(--text-muted);
    font-size: 18px;
}
.input-control.has-icon {
    padding-left: var(--space-10);
}

.form-alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: 14px;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-page);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 96px; height: 96px; }

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: var(--space-4); }

/* Layout Wrappers */
.main-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--space-4);
}

/* Toast System */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.toast {
    background: var(--surface);
    color: var(--text-primary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--primary);
}
.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--danger); }
.toast.show { transform: translateX(0); }
