:root {
    --blue: #3f66f0;
    --blue-dark: #254bd2;
    --bg: #17191f;
    --line: #d9dce5;
    --text: #181b24;
    --muted: #6f7480;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top, #30343d, var(--bg));
    color: var(--text);
}

a {
    color: var(--blue);
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.transfer-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.brand {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.brand img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    border-radius: 50%;
}

.brand-wide img {
    width: 210px;
    height: auto;
    max-height: 120px;
    border-radius: 0;
}

.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    font-size: 14px;
}

.top-actions a {
    color: var(--muted);
    text-decoration: none;
}

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

.upload-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.captcha-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
    min-height: 78px;
}

input,
textarea,
select {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 2px;
    font: inherit;
    outline: none;
    color: var(--text);
    background: transparent;
}

select {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.file-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 118px;
    overflow: hidden;
    border-radius: 12px;
    background: #e9efff;
    color: var(--text) !important;
    display: grid !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.file-box input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.file-box strong {
    display: block;
    margin-top: 8px;
    font-size: 16px;
}

.file-box small {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

.upload-progress {
    --upload-progress: 0%;
    display: grid;
    justify-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(246, 167, 139, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 28%, rgba(223, 83, 48, 0.1), transparent 48%),
        rgba(22, 20, 21, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 46px rgba(0, 0, 0, 0.22),
        0 0 30px rgba(213, 72, 44, 0.05);
    backdrop-filter: blur(14px);
}

.upload-logo-stage {
    position: relative;
    width: min(228px, 72vw);
    max-width: 100%;
    aspect-ratio: 1280 / 825;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.3));
}

.upload-logo-ghost,
.upload-logo-color {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-logo-ghost {
    opacity: 0.13;
    filter: grayscale(0.55) saturate(0.7) brightness(1.2);
}

.upload-logo-reveal {
    position: absolute;
    inset: 0;
    clip-path: inset(calc(100% - var(--upload-progress)) 0 0 0);
    transition: clip-path 180ms ease-out;
}

.upload-complete-check {
    position: absolute;
    right: 1%;
    bottom: 4%;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 188, 161, 0.5);
    border-radius: 50%;
    background: linear-gradient(135deg, #b93136, #ed653c);
    box-shadow: 0 7px 20px rgba(213, 72, 44, 0.32);
    opacity: 0;
    transform: scale(0.72);
}

.upload-complete-check::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 11px;
    width: 8px;
    height: 13px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.upload-progress.is-complete .upload-logo-stage {
    animation: upload-logo-complete 500ms ease-out;
}

.upload-progress.is-complete .upload-complete-check {
    animation: upload-check-in 360ms 120ms ease-out forwards;
}

.upload-status {
    display: grid;
    justify-items: center;
    gap: 3px;
}

.upload-status .progress-percent {
    color: #f47a55;
    font-size: clamp(24px, 6vw, 28px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.progress-track {
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b93136, #ed653c, #f58b69);
    box-shadow: 0 0 12px rgba(237, 101, 60, 0.42);
    transition: width 180ms ease-out;
}

.upload-progress p {
    margin: 0;
    color: #f4f0ed;
    font-size: 14px;
    font-weight: 700;
}

.upload-progress .upload-error {
    color: #ff9b86;
    font-weight: 400;
    text-align: center;
}

.upload-progress.has-error .progress-bar {
    background: #dc2626;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@keyframes upload-logo-complete {
    50% { transform: scale(1.025); filter: drop-shadow(0 0 18px rgba(237, 101, 60, 0.3)); }
}

@keyframes upload-check-in {
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .upload-logo-reveal,
    .progress-bar {
        transition: none;
    }

    .upload-progress.is-complete .upload-logo-stage,
    .upload-progress.is-complete .upload-complete-check {
        animation-duration: 1ms;
        animation-delay: 0ms;
    }
}

button,
.copy-btn,
.whatsapp-btn {
    border: 0;
    border-radius: 14px;
    padding: 15px 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

button:hover,
.copy-btn:hover,
.whatsapp-btn:hover {
    background: var(--blue-dark);
}

.admin-link {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: var(--muted);
    text-decoration: none;
}

.flash {
    position: fixed;
    top: 16px;
    left: 50%;
    width: min(420px, calc(100% - 32px));
    transform: translateX(-50%);
    background: #fff4e0;
    border: 1px solid #ffd38c;
    border-radius: 12px;
    padding: 10px 14px;
    z-index: 10;
}

.flash p {
    margin: 0;
}

.success-card {
    text-align: center;
}

.login-card h1,
.login-card .muted {
    text-align: center;
}

h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.muted {
    color: var(--muted);
}

.share-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 18px 0;
}

.share-box input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #1fb859;
}

.wa-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #25d366;
    font-size: 11px;
    font-weight: 800;
}

.admin-page {
    width: min(1200px, 100%);
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #eef0f5;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    overflow-wrap: anywhere;
}

th {
    background: #f7f8fb;
}

.filename-cell,
.share-link-cell,
.text-cell {
    max-width: 220px;
}

.filename-cell span,
.share-link-cell a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.share-link-cell a {
    word-break: break-all;
}

.text-cell div {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.message-cell div {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.active {
    color: #0c7d3a;
    background: #e8f8ef;
}

.badge.expired {
    color: #b42318;
    background: #fff0ee;
}

.badge.inactive {
    color: #5f2933;
    background: #fbe9ed;
}

.action-cell {
    min-width: 130px;
}

.action-cell form {
    margin-top: 10px;
}

.small-danger,
.small-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    border-radius: 8px;
    padding: 9px 12px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.small-danger {
    background: #dc2626;
}

.small-danger:hover {
    background: #b91c1c;
}

.small-success {
    background: #16a34a;
}

.small-success:hover {
    background: #15803d;
}

.empty {
    text-align: center;
    color: var(--muted);
}

@media (max-width: 560px) {
    .page {
        padding: 16px;
        align-items: flex-start;
    }

    .share-box {
        grid-template-columns: 1fr;
    }

    .admin-page {
        padding: 14px;
    }
}

/* Prime Studio login and transfer experience */
.page:has(.studio-layout) {
    position: relative;
    background:
        radial-gradient(ellipse 42% 48% at 13% 47%, rgba(175, 49, 36, 0.18), transparent 72%),
        radial-gradient(ellipse 34% 45% at 88% 20%, rgba(221, 91, 43, 0.11), transparent 76%),
        linear-gradient(135deg, #121316, #090a0c 58%, #15100f);
}

.page:has(.studio-layout)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.28;
    background: repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.035) 80px);
}

.studio-layout {
    position: relative;
    width: min(1440px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 76px);
}

.studio-mobile-note {
    display: none;
}

.studio-side {
    min-width: 0;
    height: min(650px, 80vh);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #d1c5c0;
}

.studio-eyebrow,
.studio-index,
.studio-corner-note,
.studio-frame-label {
    color: #a89994;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1.6;
}

.studio-side-copy {
    padding-left: clamp(0px, 2vw, 34px);
}

.studio-side-copy p {
    margin: 20px 0 26px;
    color: #f2eee9;
    font-size: clamp(32px, 3.5vw, 58px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.studio-side-copy em,
.studio-vision em {
    color: #f36a43;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
}

.studio-rule {
    display: block;
    width: 42px;
    height: 2px;
    margin-bottom: 23px;
    background: #d64d35;
}

.studio-services {
    display: grid;
    gap: 13px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #b8aca8;
    font-size: 13px;
    letter-spacing: 0.08em;
}

.studio-services li::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 1px;
    margin: 0 12px 4px 0;
    background: #c95a43;
}

.studio-side-right {
    align-items: flex-end;
    justify-content: center;
    gap: 18px;
    padding-top: 30px;
}

.studio-film-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1.42;
    border: 1px solid rgba(242, 218, 203, 0.24);
    background:
        radial-gradient(ellipse at 50% 42%, rgba(229, 112, 66, 0.2), transparent 48%),
        linear-gradient(150deg, rgba(127, 48, 34, 0.18), rgba(10, 10, 12, 0.5) 58%);
    box-shadow: inset 0 0 0 10px rgba(9, 10, 12, 0.85), 0 20px 55px rgba(0, 0, 0, 0.18);
}

.studio-film-frame::before,
.studio-film-frame::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    height: 5px;
    background: repeating-linear-gradient(90deg, #a77e73 0 8px, transparent 8px 28px);
    opacity: 0.42;
}

.studio-film-frame::before { top: 3px; }
.studio-film-frame::after { bottom: 3px; }

.studio-film-focus {
    position: absolute;
    inset: 26% 25%;
    border: 1px solid rgba(245, 221, 207, 0.25);
}

.studio-film-cross {
    position: absolute;
    left: 50%;
    width: 1px;
    height: 18px;
    background: rgba(245, 221, 207, 0.35);
}

.studio-film-cross-top { top: 18%; }
.studio-film-cross-bottom { bottom: 18%; }

.share-layout .studio-film-frame {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 24px;
}

.studio-qr-card {
    position: relative;
    z-index: 1;
    width: min(210px, 78%);
    display: grid;
    justify-items: center;
    border: 1px solid rgba(220, 116, 87, 0.72);
    border-radius: 12px;
    padding: 10px;
    background: #faf9f6;
    box-shadow: 0 12px 34px rgba(213, 72, 44, 0.16);
    color: #514845;
    text-decoration: none;
}

.studio-qr-card img {
    display: block;
    width: 100%;
    height: auto;
}

.studio-qr-card span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.4;
}

.studio-qr-card:focus-visible {
    outline: 2px solid #f06b47;
    outline-offset: 4px;
}

.studio-vision {
    width: 100%;
    margin: 8px 0;
    color: #eee8e3;
    font-size: clamp(23px, 2.4vw, 34px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.16;
}

.studio-rec-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ec5c3b;
}

.studio-card {
    width: 100%;
    min-width: 0;
    border: 1px solid #34302f;
    border-radius: 20px;
    padding: 20px 24px;
    background: #111214;
    color: #f4f0ed;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48), 0 0 60px rgba(213, 72, 44, 0.06);
}

.studio-card .brand {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 12px;
    background: #000;
}

.studio-card .brand-wide img {
    width: 160px;
    max-height: 104px;
}

.studio-card .top-actions {
    margin-bottom: 2px;
}

.studio-card .upload-form {
    gap: 10px;
}

.studio-card .upload-form label {
    gap: 5px;
}

.compact-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.8fr);
    gap: 10px;
    align-items: end;
}

.studio-card h1 {
    color: #f5f0ec;
    font-size: 28px;
    letter-spacing: -0.035em;
}

.studio-card .muted,
.studio-card .upload-form label,
.studio-card .admin-link,
.studio-card .top-actions a {
    color: #b9aeaa;
}

.studio-card .upload-form input:not([type="file"]),
.studio-card .upload-form textarea,
.studio-card .upload-form select {
    border: 1px solid #39383a;
    border-radius: 10px;
    padding: 10px 12px;
    background: #1d1e21;
    color: #f4f0ed;
    color-scheme: dark;
}

.studio-card .upload-form input::placeholder,
.studio-card .upload-form textarea::placeholder {
    color: #968d8a;
}

.studio-card .upload-form input:focus-visible,
.studio-card .upload-form textarea:focus-visible,
.studio-card .upload-form select:focus-visible,
.studio-card .file-box:focus-within {
    outline: 2px solid #f06b47;
    outline-offset: 2px;
}

.studio-card .file-box {
    min-height: 104px;
    border: 1px dashed #865246;
    background: linear-gradient(135deg, #2a1d1b, #1a1b1e 70%);
    color: #f4f0ed !important;
}

.studio-card .file-icon,
.studio-card .upload-form button {
    background: linear-gradient(110deg, #b93136, #ed653c);
}

.studio-card .upload-form .animation-test-button {
    border: 1px solid #554744;
    padding: 11px 16px;
    background: #232326;
    color: #d8cfca;
    font-size: 14px;
}

.studio-card .upload-form .animation-test-button:hover {
    border-color: #865246;
    background: #2c2929;
}

.studio-card .upload-form button:hover {
    background: linear-gradient(110deg, #a5262c, #d75331);
}

.studio-card .file-box small {
    color: #b9aeaa;
}

.studio-card #transfer-button {
    padding: 12px 18px;
}

.studio-card .admin-link {
    margin-top: 12px;
    font-size: 13px;
}

.studio-card .captcha-wrap {
    min-width: 304px;
}

.studio-card .top-actions a:hover,
.studio-card .admin-link:hover {
    color: #f58b69;
}

.share-card {
    padding: 30px;
}

.share-card .brand {
    margin-bottom: 26px;
}

.share-kicker {
    display: block;
    margin-bottom: 10px;
    color: #dc7457;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.share-card h1 {
    overflow-wrap: anywhere;
    font-size: clamp(26px, 5vw, 34px);
}

.share-filename {
    margin: 10px 0 0;
    color: #b9aeaa;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.share-message {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #39383a;
    border-radius: 12px;
    background: #1a1b1e;
}

.share-message span {
    display: block;
    margin-bottom: 8px;
    color: #968d8a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.share-message p {
    margin: 0;
    color: #e8e1dc;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.share-expiry {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
    color: #b9aeaa;
    font-size: 13px;
}

.share-expiry span {
    color: #dc7457;
    font-size: 17px;
}

.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 26px;
}

.share-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 14px 18px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.share-button-primary {
    background: linear-gradient(110deg, #b93136, #ed653c);
}

.share-button-primary:hover {
    background: linear-gradient(110deg, #a5262c, #d75331);
}

.share-button-secondary {
    border-color: #554744;
    background: #232326;
}

.share-button-secondary:hover {
    border-color: #dc7457;
    background: #2c2929;
}

.share-button:focus-visible {
    outline: 2px solid #f06b47;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .studio-layout {
        width: min(440px, 100%);
        display: block;
    }

    .studio-side { display: none; }

    .share-layout .studio-side-right {
        width: 100%;
        height: auto;
        display: flex;
        align-items: center;
        gap: 0;
        margin-top: 18px;
        padding-top: 0;
    }

    .share-layout .studio-side-right > .studio-frame-label,
    .share-layout .studio-vision {
        display: none;
    }

    .share-layout .studio-film-frame {
        width: min(320px, 100%);
    }

    .studio-mobile-note {
        display: block;
        margin: 0 0 14px;
        color: #f3e8e2;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        line-height: 1.5;
        text-align: center;
        text-transform: uppercase;
    }

    .studio-mobile-note span {
        display: block;
        color: #dc7457;
        font-weight: 400;
        letter-spacing: 0.07em;
    }
}

@media (max-width: 560px) {
    .studio-card { padding: 20px 16px; }
    .studio-card .brand-wide img { width: 145px; }
    .compact-form-row { grid-template-columns: 1fr; }
    .share-actions { grid-template-columns: 1fr; }
    .share-card { padding: 24px 18px; }
}

@media (max-width: 370px) {
    .page:has(.studio-layout) { padding: 0; }
    .studio-card { border-radius: 0; padding: 20px 7px; }
    .studio-mobile-note { padding: 12px 7px 0; }
    .share-layout .studio-side-right { padding: 0 12px 20px; }
}
