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

:root {
    --gradient-bg: linear-gradient(200deg, #e72486 0%, #882f7f 100%);
    --footer-gradient: linear-gradient(-90deg, #00a1db 0%, #e72486 100%);
    --primary-pink: #e72486;
    --primary-blue: #00a1db;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: rgba(0, 0, 0, 0.08);
    --white: #ffffff;
    --ts-shadow: 0 24px 50px rgba(16, 24, 40, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: #ffffff;
    line-height: 1.6;
}

.tradein-session {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #ffffff;
}

.ts-shell {
    width: min(1180px, 100%);
    background: var(--gradient-bg);
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--ts-shadow);
    display: flex;
    flex-direction: column;
}

.ts-hero {
    background: var(--gradient-bg);
    color: #fff;
    padding: 22px 28px;
    position: relative;
}

.ts-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.2), transparent 55%);
    pointer-events: none;
}

.ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.ts-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ts-logo {
    height: 46px;
    width: auto;
}

.ts-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-tablet-identity {
    font-size: 13px;
    opacity: 0.9;
}

.ts-tablet-identity-separator {
    margin: 0 6px;
    opacity: 0.6;
}

.ts-header-side {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 400px;
}

.ts-kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    opacity: 0.8;
}

.ts-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin: 0;
}

.ts-subtitle {
    font-size: 14px;
    opacity: 0.9;
    max-width: 480px;
}

.ts-header-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    min-width: 170px;
    text-align: right;
    backdrop-filter: blur(10px);
}

.ts-header-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.75;
}

.ts-header-value {
    font-size: 19px;
    font-weight: 700;
}

.ts-header-meta {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.8;
}

.ts-body {
    padding: 22px 28px 16px;
    background: #f7f9fc;
    flex: 1;
}

.ts-alert {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff4e5;
    color: #925a12;
    border: 1px solid #f3d7ad;
}

.ts-idle {
    padding: 24px 0 12px;
    display: flex;
    justify-content: center;
}

.ts-idle-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px 26px;
    text-align: center;
    max-width: 520px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.ts-auth-card {
    width: min(540px, 100%);
    text-align: left;
}

.ts-auth-form {
    display: grid;
    gap: 14px;
}

.ts-field {
    display: grid;
    gap: 6px;
    text-align: left;
}

.ts-field span {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.ts-field input,
.ts-field select {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text-dark);
}

.ts-field input:focus,
.ts-field select:focus {
    outline: none;
    border-color: rgba(0, 161, 219, 0.65);
    box-shadow: 0 0 0 3px rgba(0, 161, 219, 0.16);
}

.ts-idle-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.ts-idle-card h3 {
    font-family: 'Sora', 'Inter', sans-serif;
    margin: 0 0 8px;
}

.ts-idle-card p {
    color: var(--text-light);
    margin: 0 0 18px;
}

.ts-idle-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
}

.ts-idle-form {
    margin: 0;
}

.ts-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ts-grid--single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ts-column {
    display: grid;
    gap: 16px;
}

.ts-card {
    background: var(--white);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.ts-card-accent {
    border-color: rgba(0, 161, 219, 0.2);
    background: linear-gradient(150deg, rgba(0, 161, 219, 0.14), rgba(231, 36, 134, 0.12));
}

.ts-card-title {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 10px;
}

.ts-card-body {
    display: grid;
    gap: 10px;
}

.ts-disclaimer {
    background: #fff8ec;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    color: #5a4a37;
    line-height: 1.4;
}

.ts-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.ts-row span {
    color: var(--text-light);
}

.ts-amount {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ts-signature-card {
    position: sticky;
    top: 18px;
    align-self: start;
}

.ts-confirm-card .ts-card-body {
    gap: 16px;
}

.ts-note {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 0;
}

.ts-signature-pad {
    border: 2px dashed rgba(0, 161, 219, 0.4);
    border-radius: 16px;
    background: #fff;
    padding: 12px;
    position: relative;
    min-height: 200px;
}

.ts-signature-pad canvas {
    width: 100%;
    height: 200px;
    display: block;
    border-radius: 12px;
    background: #fff;
    touch-action: none;
}

.ts-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 12px;
}

.ts-checkbox input {
    margin-top: 3px;
}

.ts-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.ts-actions-left {
    justify-content: flex-start;
}

.ts-btn {
    border: none;
    border-radius: 50px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ts-btn-primary {
    background: var(--gradient-bg);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(231, 36, 134, 0.3);
}

.ts-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 161, 219, 0.35);
}

.ts-btn-ghost {
    background: #ffffff;
    border: 1px solid rgba(0, 161, 219, 0.35);
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-dark);
}

.ts-signature-pad .ts-btn-ghost {
    position: absolute;
    right: 16px;
    bottom: 16px;
}

.ts-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: center;
}

.ts-header-actions form {
    margin: 0;
}

.ts-countdown {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.ts-signature-error {
    margin-top: 10px;
    font-size: 12px;
    color: #b42318;
    min-height: 16px;
}

.ts-thanks {
    margin-top: 24px;
    text-align: center;
    padding: 20px 0 10px;
}

.ts-thanks-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-bg);
    color: #fff;
    font-size: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.ts-thanks h2 {
    font-family: 'Sora', 'Inter', sans-serif;
    margin-bottom: 8px;
}

.ts-thanks p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.ts-footer {
    background: var(--footer-gradient);
    border-radius: 0 0 16px 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.ts-footer-logo {
    height: 40px;
    width: auto;
}

.ts-footer-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ts-footer-meta {
    font-size: 12px;
    opacity: 0.85;
}

@media (max-width: 900px) {
    .ts-grid {
        grid-template-columns: 1fr;
    }

    .ts-signature-card {
        position: static;
    }

    .ts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ts-header-card {
        text-align: left;
        width: 100%;
    }

    .ts-header-side {
        width: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
        justify-content: flex-start;
    }

    .ts-body {
        padding: 20px 20px 12px;
    }

    .ts-footer {
        margin: 0 18px 18px;
        flex-direction: column;
        align-items: flex-start;
    }
}
