/* ================================================
   FileKitPro — Common Styles (extracted from common12.css)
   Only CSS used by templates/base.html, index.html, pricing.html
   ================================================ */

/* ----- CSS Variables (updated palette) ----- */
:root {
    --color-brand: #4d65ff;
    --color-brand-hover: #3d55ef;
    --color-brand-light: #6b7dff;
    --color-brand-lightest: rgba(77, 101, 255, 0.08);
    --background-gray-main: #f8f8f7;
    --background-menu-white: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-tertiary: #8888a0;
    --text-on-dark: #ffffff;
    --text-disabled: #9ca3af;
    --border-main: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.05);
    --border-hover: rgba(0, 0, 0, 0.12);
    --fill-tsp-white-light: rgba(0, 0, 0, 0.04);
    --fill-tsp-white-main: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --Button-black: #1a1a2e;
    --text-onblack: #ffffff;
    --logo-color: #1a1a2e;
    --thumb-selected-color: #4d65ff;
    --thumb-range-color: rgba(77, 101, 255, 0.5);
    --badge-bg: rgba(77, 101, 255, 0.08);
    --badge-color: var(--color-brand);
    --badge-border: rgba(77, 101, 255, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background-gray-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.font-serif {
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* Text baseline alignment (unchanged) */
:is(h1, h2, h3, h4, h5, h6, p, .u-text-style-) {
    display: flow-root;
    user-select: text;
}
:is(h1, h2, h3, h4, h5, h6, p, .u-text-style-)::before {
    content: "";
    display: table;
    margin-bottom: calc(-0.5lh + 0.36em);
    user-select: none;
}
:is(h1, h2, h3, h4, h5, h6, p, .u-text-style-)::after {
    content: "";
    display: table;
    margin-bottom: calc(-0.5lh + 0.41em);
    user-select: none;
}

/* ----- Site Header (modern, glass) ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-light);
    transition: border-color 0.3s;
}

/* ----- Brand Button (primary) ----- */
.btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--Button-black);
    color: var(--text-onblack);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

/* ----- Pro Badge ----- */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* ----- User Menu (avatar + dropdown) ----- */
.user-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-main);
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 1.25rem;
    position: relative;
    outline: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.user-avatar-btn.dropdown-open {
    border-color: var(--color-brand);
    color: var(--color-brand);
    background: var(--color-brand-lightest);
    box-shadow: 0 2px 12px rgba(77, 101, 255, 0.18);
}

.user-avatar-initial {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    max-width: calc(100vw - 2rem);
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 1rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 0;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    pointer-events: none;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-dropdown::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid var(--border-main);
    border-top: 1px solid var(--border-main);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

.user-dropdown-header {
    padding: 1rem 1.2rem 0.75rem;
    border-bottom: 1px solid var(--border-main);
}

.user-dropdown-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
}

.user-dropdown-email i {
    color: var(--color-brand);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-dropdown-subscription {
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-dropdown-subscription .pro-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
}

.user-dropdown-subscription .pro-info {
    font-size: 0.7rem;
    color: #92400e;
    font-weight: 500;
    white-space: nowrap;
}

.user-dropdown-subscription .btn-upgrade-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.78rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}

.user-dropdown-subscription .btn-upgrade-sm:hover {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.free-plan-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.user-dropdown-actions {
    padding: 0.5rem 0.6rem;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    text-align: left;
    white-space: nowrap;
}

.user-dropdown-item i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.user-dropdown-item.logout-item {
    color: #e0555a;
}

.user-dropdown-item.logout-item:hover {
    background: #fef2f2;
    color: #d14343;
}

/* ----- Selection & Scrollbar ----- */
::selection {
    background: var(--color-brand);
    color: #fff;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #f0f0f3;
}

::-webkit-scrollbar-thumb {
    background: #c5c5d5;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0b5;
}

/* ----- Footer Link ----- */
footer a {
    transition: color 0.25s;
}

footer a:hover {
    color: var(--color-brand);
}

/* ----- Toast notification ----- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 0.85rem 1.6rem;
    border-radius: 3rem;
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

.toast.error { border-color: rgba(224, 85, 90, 0.5); background: #fff5f5; color: #b91c1c; }

.toast.success { border-color: rgba(16, 185, 129, 0.5); background: #f0fdf6; color: #065f46; }

.toast.warning { border-color: rgba(245, 158, 11, 0.5); background: #fffbeb; color: #92400e; }

/* ----- Responsive Tweaks (common) ----- */
@media screen and (max-width: 767px) {
    .user-avatar-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    .user-dropdown {
        min-width: 250px;
        right: -10px;
    }
    .user-dropdown::before {
        right: 22px;
    }
}

@media screen and (max-width: 479px) {
    .user-dropdown {
        min-width: 220px;
        right: -20px;
        border-radius: 0.85rem;
    }
    .user-dropdown::before {
        right: 32px;
    }
    .user-dropdown-header {
        padding: 0.8rem 1rem 0.6rem;
    }
    .user-dropdown-subscription {
        padding: 0.6rem 1rem;
    }
    .user-dropdown-actions {
        padding: 0.35rem 0.4rem;
    }
    .user-dropdown-item {
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
    }
}

/* =============================================
   Tailwind Replacement Utilities
   ============================================= */

/* ----- Container widths ----- */
.max-w-2xl { max-width: 42rem; }

/* ----- Flex & Grid helpers ----- */
.flex           { display: flex; }
.flex-wrap      { flex-wrap: wrap; }
.flex-col       { flex-direction: column; }
.flex-shrink-0  { flex-shrink: 0; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-3   { gap: 0.75rem; }
.gap-4   { gap: 1rem; }
.gap-6   { gap: 1.5rem; }

/* ----- Spacing (padding & margin) ----- */
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-8 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ----- Typography ----- */
.text-center   { text-align: center; }
.text-sm       { font-size: 0.875rem; }
.text-2xl      { font-size: 1.5rem; }
.text-4xl      { font-size: 2.25rem; }
.font-bold     { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-tight  { line-height: 1.25; }
.text-gray-800 { color: #1f2937; }

/* ----- Width & Height ----- */
.w-full { width: 100%; }
.w-10   { width: 2.5rem; }

/* ----- Positioning & z-index ----- */
.relative { position: relative; }
.z-10 { z-index: 10; }

/* ----- Overflow ----- */
.overflow-hidden { overflow: hidden; }

/* ----- Visual effects ----- */
.rounded-xl   { border-radius: 0.75rem; }
.shadow-sm    { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }

/* ----- Interactions ----- */
.no-underline        { text-decoration: none; }

/* ----- Accessibility & misc ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Responsive overrides (mobile-first) ----- */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:text-6xl { font-size: 3.75rem; }
}

/* ----- Max widths ----- */
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

/* ----- Flex ----- */
.flex-1 { flex: 1 1 0%; }

/* ----- Spacing ----- */
.mt-1\.5 { margin-top: 0.375rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.pb-8  { padding-bottom: 2rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

/* ----- Misc ----- */
.object-contain { object-fit: contain; }

/* =============================================
   STYLES FROM common12.css
   (used by templates: terms.html, privacy.html, auth.html)
   ============================================= */

/* ----- Outline Button ----- */
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid rgba(77, 101, 255, 0.4);
    padding: 0.6rem 1.4rem;
    border-radius: 3rem;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-outline:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
    background: var(--color-brand-lightest);
}

/* ----- Glass Card ----- */
.glass-card {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 1.1rem;
    padding: 1.4rem;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.glass-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    background: #fafafd;
}

/* ----- Display helpers ----- */
.block { display: block; }
.hidden { display: none !important; }

/* ----- Positioning helpers ----- */
.absolute { position: absolute; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.pointer-events-none { pointer-events: none; }

/* ----- Typography additions ----- */
.font-light    { font-weight: 300; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-xs       { font-size: 0.75rem; }
.text-lg       { font-size: 1.125rem; }
.text-3xl      { font-size: 1.875rem; }
.leading-relaxed  { line-height: 1.625; }
.tracking-wide   { letter-spacing: 0.025em; }
.uppercase { text-transform: uppercase; }

/* ----- Text color additions ----- */
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }

/* ----- Spacing additions ----- */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.p-6  { padding: 1.5rem; }
.pt-10 { padding-top: 2.5rem; }
.py-6  { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pb-16 { padding-bottom: 4rem; }
.gap-2   { gap: 0.5rem; }

.space-y-4 > * + * { margin-top: 1rem; }

/* ----- Width & Height additions ----- */
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.h-24 { height: 6rem; }

/* ----- Visual effects additions ----- */
.rounded-2xl  { border-radius: 1rem; }

/* ----- Gradient utility additions ----- */
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.from-white { --tw-gradient-from: #fff; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(255, 255, 255, 0)); }
.to-transparent { --tw-gradient-to: transparent; }

/* =============================================
   STYLES FROM common12.css
   (used by templates: checkout.html, profile.html, success.html)
   ============================================= */

/* ----- Modal components ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    transition: opacity 0.25s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0.5rem;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4d65ff, #6b7dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ----- Spacing additions ----- */
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.space-y-6 > * + * { margin-top: 1.5rem; }
