/* =========================================================
   Fonts
   ========================================================= */

@font-face {
    font-family: "Lato";
    src: url("../fonts/Lato/Lato-Regular.woff2") format("woff2"),
    url("../fonts/Lato/Lato-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Lato";
    src: url("../fonts/Lato/Lato-Italic.woff2") format("woff2"),
    url("../fonts/Lato/Lato-Italic.woff") format("woff");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Lato";
    src: url("../fonts/Lato/Lato-Bold.woff2") format("woff2"),
    url("../fonts/Lato/Lato-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Lato";
    src: url("../fonts/Lato/Lato-BoldItalic.woff2") format("woff2"),
    url("../fonts/Lato/Lato-BoldItalic.woff") format("woff");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Libre Baskerville";
    src: url("../fonts/LibreBaskerville/LibreBaskerville-Regular.woff2") format("woff2"),
    url("../fonts/LibreBaskerville/LibreBaskerville-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Libre Baskerville";
    src: url("../fonts/LibreBaskerville/LibreBaskerville-Italic.woff2") format("woff2"),
    url("../fonts/LibreBaskerville/LibreBaskerville-Italic.woff") format("woff");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Libre Baskerville";
    src: url("../fonts/LibreBaskerville/LibreBaskerville-Bold.woff2") format("woff2"),
    url("../fonts/LibreBaskerville/LibreBaskerville-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   Variables
   ========================================================= */

:root {
    --brand: #6195AB;
    --brand-dark: #186d75;
    --brand-darker: #13585f;
    --brand-soft: #eaf7f8;
    --brand-softer: #f4fbfc;
    --brand-rgb: 31, 132, 142;

    --accent: #3b3b67;
    --accent-dark: #2d2d50;
    --accent-rgb: 59, 59, 103;

    --ink: #17232b;
    --muted: #667085;
    --line: #dfeaec;
    --surface: #ffffff;
    --soft: #f6fbfc;

    --danger: #b42318;
    --danger-soft: #fff1f0;

    --radius-lg: 1.25rem;
    --radius-xl: 1.75rem;
    --radius-xxl: 2rem;

    --shadow-soft: 0 1.25rem 4rem rgba(var(--brand-rgb), 0.08);
    --shadow-card: 0 1.875rem 5.625rem rgba(var(--brand-rgb), 0.14);
    --shadow-control: 0 0.625rem 1.5rem rgba(20, 30, 40, 0.12);

    --bs-body-font-size: 15px;

    /* Legacy aliases */
    --primary: var(--brand);
    --secondary: var(--accent);
    --dark: var(--ink);
}


/* =========================================================
   Base
   ========================================================= */

@media (min-width: 1400px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        max-width: 1350px;
    }
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--brand) #edf7f8;
}

body {
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
            radial-gradient(circle at top left, rgba(var(--brand-rgb), 0.12), transparent 32rem),
            radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08), transparent 28rem),
            linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Libre Baskerville", Georgia, serif;
    font-weight: 700;
    color: var(--ink);
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-dark);
}

.text-brand {
    color: var(--brand) !important;
}

.bg-brand {
    background-color: var(--brand) !important;
}

.bg-brand-soft {
    background-color: var(--brand-soft) !important;
}


/* =========================================================
   Buttons
   ========================================================= */

.btn-brand,
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
    --bs-btn-active-bg: var(--brand-darker);
    --bs-btn-active-border-color: var(--brand-darker);

    border-radius: 999px;
    font-weight: 800;
    padding: 0.8rem 1.35rem;
    box-shadow: 0 14px 34px rgba(var(--brand-rgb), 0.22);
}

.btn-brand.btn-sm {
    padding: 0.55rem 1rem;
}

.btn-soft {
    background: rgba(var(--brand-rgb), 0.10);
    border: 1px solid rgba(var(--brand-rgb), 0.12);
    color: var(--brand);
    border-radius: 999px;
    font-weight: 800;
    padding: 0.9rem 1.35rem;
}

.btn-soft:hover {
    background: rgba(var(--brand-rgb), 0.16);
    border-color: rgba(var(--brand-rgb), 0.18);
    color: var(--brand-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-color: #6c757d;
    --bs-btn-disabled-bg: #e2e6ea;
    --bs-btn-disabled-border-color: #ced4da;

    border-radius: 999px;
    font-weight: 700;
    padding: 0.8rem 1.3rem;
}

.btn-primary:disabled,
.btn-outline-primary:disabled,
.btn-brand:disabled {
    background: #e2e6ea;
    border-color: #ced4da;
    color: #6c757d;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
}


/* =========================================================
   Navigation
   ========================================================= */

.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(var(--brand-rgb), 0.12);
}

.navbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar-brand-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
}

.navbar-brand-custom img {
    flex: 0 0 auto;
    border-radius: 14px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link-custom {
    color: rgba(23, 35, 43, 0.75);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.nav-link-custom:hover {
    color: var(--brand);
}


/* =========================================================
   Hero
   ========================================================= */

.hero {
    padding: clamp(70px, 8vw, 120px) 0 clamp(60px, 7vw, 100px);
}

.hero-split {
    position: relative;
    overflow: hidden;
}

.hero-split::before {
    content: "";
    position: absolute;
    inset: -20% auto auto -10%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.16), transparent 68%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 670px;
    margin: 0 auto;
    text-align: center;
}

.eyebrow,
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.35rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.10);
    color: var(--brand-darker);
    font-weight: 800;
    font-size: 0.88rem;
    border: 1px solid rgba(var(--brand-rgb), 0.14);
}

.hero-title {
    font-size: clamp(2.7rem, 7vw, 4.8rem);
    line-height: 1.12;
    letter-spacing: -0.055em;
    font-weight: 700;
    max-width: 980px;
    margin: 0 auto 1.5rem;
    color: var(--ink);
}

.hero-subtitle {
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.65;
    max-width: 780px;
    margin: 0 auto 2rem;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    justify-content: center;
    margin-top: 1.8rem;
    color: rgba(23, 35, 43, 0.72);
    font-weight: 700;
    font-size: 0.95rem;
}

.hero-trust i {
    color: var(--brand);
    margin-right: 0.25rem;
}

.hero-visual {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-blob-img {
    position: absolute;
    max-width: 150%;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.hero-blob {
    position: absolute;
    width: 430px;
    height: 430px;
    border-radius: 38% 62% 55% 45% / 45% 35% 65% 55%;
    background:
            radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), transparent 32%),
            linear-gradient(135deg, rgba(var(--brand-rgb), 0.24), rgba(var(--accent-rgb), 0.12));
    filter: blur(0.2px);
    animation: blobFloat 9s ease-in-out infinite;
}

@keyframes blobFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        border-radius: 38% 62% 55% 45% / 45% 35% 65% 55%;
    }

    50% {
        transform: translateY(-14px) rotate(4deg);
        border-radius: 58% 42% 45% 55% / 55% 45% 55% 45%;
    }
}


/* =========================================================
   Hero PDF Preview
   ========================================================= */

.pdf-preview-card {
    position: relative;
    z-index: 2;
    width: min(420px, 92vw);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(var(--brand-rgb), 0.18);
    border-radius: 30px;
    padding: 1.6rem;
    box-shadow: var(--shadow-card);
    transform: rotate(-2deg);
    text-align: left;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.preview-badge {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(var(--brand-rgb), 0.10);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.skeleton-line,
.line {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--brand-rgb), 0.12), rgba(var(--accent-rgb), 0.11));
    margin-bottom: 0.75rem;
}

.skeleton-line.tiny {
    height: 8px;
    background: rgba(var(--brand-rgb), 0.16);
}

.skeleton-line.title {
    height: 18px;
    background: var(--ink);
    opacity: 0.9;
}

.preview-lines {
    margin-bottom: 2rem;
}

.signature-preview-area {
    position: relative;
    min-height: 150px;
    border: 1px dashed rgba(var(--brand-rgb), 0.35);
    border-radius: 22px;
    background: rgba(244, 251, 252, 0.75);
    margin-bottom: 1.4rem;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.signature-line {
    display: block;
    height: 1px;
    background: rgba(23, 35, 43, 0.28);
    margin-top: auto;
}

.signature-text {
    color: rgba(23, 35, 43, 0.55);
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.signature-doodle {
    position: absolute;
    left: 2rem;
    right: 2rem;
    bottom: 2.4rem;
    color: var(--accent);
}

.signature-doodle svg {
    width: 100%;
    height: auto;
}

.preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.privacy-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.10);
    color: var(--brand);
    font-weight: 800;
    font-size: 0.85rem;
}

.download-pill {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 12px 28px rgba(var(--brand-rgb), 0.24);
}

.floating-card {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(var(--brand-rgb), 0.16);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font-weight: 800;
    color: var(--accent);
    box-shadow: var(--shadow-control);
}

.floating-card i {
    color: var(--brand);
}

.floating-card-top {
    top: 70px;
    right: 18px;
}

.floating-card-bottom {
    bottom: 72px;
    left: 18px;
}


/* =========================================================
   Width helpers
   ========================================================= */

.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }


/* =========================================================
   Tool Layout
   ========================================================= */

#tool {
    position: relative;
}

.card-soft {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(var(--brand-rgb), 0.15);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
}

.card-soft h4 {
    margin-bottom: 0.75rem;
}

.next-prev button {
    padding: 0.4rem 1.7rem;
}

/* =========================================================
   PDF Viewer
   ========================================================= */

#pdfWrapper {
    position: relative;
    display: block;
    width: 100%;
    flex: 1;
    min-height: 520px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #fff;
    overflow: visible;
}

#pdfWrapper.has-pdf {
    display: inline-block;
    width: auto;
    min-height: 0;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: center;
}

#pdfCanvas {
    display: none;
    max-width: 100%;
    height: auto;
    border-radius: 18px;
}

#pdfPlaceholder {
    height: 100%;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

#pdfPlaceholder .placeholder-inner {
    max-width: 360px;
}

#pdfPlaceholder .placeholder-icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(var(--brand-rgb), 0.10);
    color: var(--brand);
    font-size: 2rem;
    margin-bottom: 1rem;
}

#overlayLayer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


/* =========================================================
   Signature Objects
   ========================================================= */

.signature-object {
    position: absolute;
    cursor: move;
    border: 2px dashed var(--brand);
    background: rgba(255, 255, 255, 0.25);
    touch-action: none;
    pointer-events: auto;
    user-select: none;
}

.signature-object.active {
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14);
}

.signature-object.locked {
    cursor: pointer;
    border: 2px solid rgba(var(--brand-rgb), 0.75);
    background: rgba(var(--brand-rgb), 0.04);
}

.signature-object img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

.signature-lock-control {
    position: absolute;
    top: -42px;
    right: -2px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    color: var(--accent);
    border: 1px solid rgba(var(--brand-rgb), 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: var(--shadow-control);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
}

.signature-lock-control input {
    margin: 0;
    cursor: pointer;
}

.signature-object.locked .signature-lock-control {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.signature-object.locked .signature-lock-control input {
    accent-color: #fff;
}

.signature-delete-control {
    position: absolute;
    top: -42px;
    left: -2px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    color: var(--danger);
    border: 1px solid rgba(180, 35, 24, 0.25);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: var(--shadow-control);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
}

.signature-delete-control:hover {
    background: var(--danger-soft);
}

.resize-handle {
    width: 18px;
    height: 18px;
    background: var(--brand);
    border-radius: 50%;
    position: absolute;
    right: -9px;
    bottom: -9px;
    cursor: nwse-resize;
}

.signature-object.locked .resize-handle {
    display: none;
}

#signaturePad {
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 16px;
    width: 100%;
    height: 180px;
    background: #fff;
}


/* =========================================================
   Legal Box
   ========================================================= */

.legal-box {
    border-left: 5px solid var(--brand);
    box-shadow: var(--shadow-soft);
    background: #fff;
    border-radius: 18px;
    padding: 1.2rem;
}

.legal-box p {
    color: #475467;
    line-height: 1.65;
}


/* =========================================================
   Modal
   ========================================================= */

.modal-content {
    border-radius: 1.5rem;
}

.modal-header,
.modal-footer {
    padding: 1.25rem 1.5rem;
}

.modal-body {
    color: var(--ink);
    scrollbar-width: thin;
    scrollbar-color: var(--brand) #edf7f8;
}

.modal-body h3 {
    color: var(--ink);
}

.modal-body p,
.modal-body li {
    color: #475467;
    line-height: 1.75;
}

.modal-body ul {
    padding-left: 1.25rem;
}


/* =========================================================
   Footer
   ========================================================= */

.footer-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-note a,
.footer-note button {
    color: var(--brand);
    font-weight: 700;
}

.footer-note a:hover,
.footer-note button:hover {
    color: var(--brand-dark);
}

footer .btn-link.footer-note {
    border: 0;
}

footer .btn-link.footer-note:hover {
    text-decoration: underline;
    background: transparent;
}


/* =========================================================
   Scrollbar
   ========================================================= */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #edf7f8;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: 999px;
    border: 3px solid #edf7f8;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2599a4 0%, var(--brand-dark) 100%);
}

::-webkit-scrollbar-corner {
    background: #edf7f8;
}

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #edf7f8;
    border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: 999px;
    border: 3px solid #edf7f8;
}

textarea.form-control {
    resize: vertical;
    scrollbar-width: thin;
    scrollbar-color: var(--brand) transparent;
}

textarea.form-control::-webkit-scrollbar {
    width: 10px;
}

textarea.form-control::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
    border-radius: 999px;
}

textarea.form-control::-webkit-scrollbar-thumb {
    background: var(--brand);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

textarea.form-control::-webkit-scrollbar-thumb:hover {
    background: var(--brand-dark);
    background-clip: padding-box;
}

textarea.form-control::-webkit-scrollbar-corner {
    background: transparent;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (min-width: 992px) {
    .hero-split {
        text-align: left;
    }

    .hero-split .hero-content {
        margin-left: 0;
        margin-right: auto;
        text-align: left;
    }

    .hero-split .eyebrow {
        margin-left: 0;
        margin-right: auto;
    }

    .hero-trust {
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .hero {
        padding: 5rem 0 3rem;
    }

    .hero-title,
    .hero-subtitle {
        text-align: center !important;
    }

    .hero-visual {
        min-height: 420px;
        margin-top: 1.5rem;
    }

    .pdf-preview-card {
        max-width: 390px;
    }

    .navbar-actions {
        gap: 0.65rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 2.5rem;
    }

    .card-soft {
        padding: 1.25rem;
        border-radius: 22px;
    }

    #pdfWrapper,
    #pdfPlaceholder {
        min-height: 430px;
    }

    .next-prev button {
        padding: 0.4rem 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-inner {
        min-height: 68px;
    }

    .navbar-brand-custom {
        font-size: 1.05rem;
    }

    .navbar-brand-custom img {
        width: 42px;
        height: 42px;
    }

    .hero-title {
        font-size: 3rem;
        letter-spacing: -0.045em;
    }

    .hero-visual {
        min-height: 360px;
    }

    .pdf-preview-card {
        padding: 1.2rem;
        border-radius: 24px;
        transform: rotate(0deg);
    }

    .floating-card {
        display: none;
    }

    .signature-lock-control,
    .signature-delete-control {
        top: -38px;
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
    }

    .next-prev {
        flex-direction: column;
        align-items: stretch !important;
    }

    .next-prev button {
        width: 100%;
    }

    #downloadPdf,
    #clearSignature,
    #addSignature {
        width: 100%;
    }
}