:root {
    --ace-pg-accent: #ff711c;
    --ace-pg-text: #171717;
    --ace-pg-muted: #6f6f6f;
}

#ace-pg-progress {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999998;
    display: none;
    align-items: center;
    gap: 12px;
    min-width: 210px;
    padding: 10px 15px 10px 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 100px;
    background: rgba(19,19,19,.94);
    color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease;
}

#ace-pg-progress.ace-visible {
    display: flex;
}

#ace-pg-progress.ace-in {
    opacity: 1;
    transform: translateY(0);
}

.ace-pg-progress-ring {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
}

.ace-pg-progress-ring svg {
    width: 46px;
    height: 46px;
    transform: rotate(-90deg);
}

.ace-pg-ring-track,
.ace-pg-ring-value {
    fill: none;
    stroke-width: 3;
}

.ace-pg-ring-track {
    stroke: rgba(255,255,255,.13);
}

.ace-pg-ring-value {
    stroke: var(--ace-pg-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset .28s ease;
}

#ace-pg-progress-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.ace-pg-progress-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ace-pg-progress-copy strong {
    font-size: 12px;
    line-height: 1.25;
    font-weight: 700;
}

.ace-pg-progress-copy span {
    color: rgba(255,255,255,.6);
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
}

.ace-pg-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(9,10,12,.44);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.ace-pg-overlay.ace-open {
    opacity: 1;
    visibility: visible;
}

.ace-pg-modal {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
    padding: 36px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0,0,0,.22), 0 5px 20px rgba(0,0,0,.08);
    color: var(--ace-pg-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 0;
    transform: translateY(12px) scale(.985);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
}

.ace-pg-overlay.ace-open .ace-pg-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ace-pg-mark {
    width: 38px;
    height: 5px;
    margin-bottom: 24px;
    border-radius: 50px;
    background: var(--ace-pg-accent);
}

.ace-pg-eyebrow {
    margin: 0 0 9px;
    color: var(--ace-pg-accent);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.ace-pg-heading {
    margin: 0 0 14px;
    color: #151515;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.ace-pg-description {
    margin: 0;
    max-width: 455px;
    color: #656565;
    font-size: 14px;
    line-height: 1.7;
}

.ace-pg-divider {
    height: 1px;
    margin: 27px 0 24px;
    background: #ececec;
}

.ace-pg-actions {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.2fr);
    gap: 10px;
}

.ace-pg-btn {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 11px;
    text-decoration: none !important;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.ace-pg-btn:hover {
    transform: translateY(-1px);
}

.ace-pg-btn-secondary {
    border: 1px solid #ddd;
    background: #fff;
    color: #222 !important;
}

.ace-pg-btn-secondary:hover {
    border-color: #c8c8c8;
    background: #fafafa;
}

.ace-pg-btn-primary {
    border: 1px solid #171717;
    background: #171717;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

.ace-pg-btn-primary:hover {
    border-color: #000;
    background: #000;
    box-shadow: 0 7px 18px rgba(0,0,0,.17);
}

.ace-pg-quick-signup {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #ececec;
}

.ace-pg-quick-signup[hidden],
.ace-pg-quick-form[hidden] {
    display: none !important;
}

.ace-pg-quick-signup-head {
    margin-bottom: 20px;
}

.ace-pg-quick-signup-head h3 {
    margin: 0 0 7px;
    color: #171717;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: -.025em;
}

.ace-pg-quick-signup-head p {
    margin: 0;
    color: #737373;
    font-size: 12px;
    line-height: 1.6;
}

.ace-pg-quick-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ace-pg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ace-pg-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ace-pg-form-field label {
    color: #444;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
}

.ace-pg-form-field input {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #dedede;
    border-radius: 9px;
    background: #fff;
    color: #171717;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ace-pg-form-field input:focus {
    border-color: var(--ace-pg-accent);
    box-shadow: 0 0 0 3px rgba(255,113,28,.10);
}

.ace-pg-signup-submit {
    width: 100%;
    margin-top: 3px;
}

.ace-pg-signup-submit:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.ace-pg-otp-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 14px;
    border-radius: 9px;
    background: #f7f7f7;
}

.ace-pg-otp-copy strong {
    color: #222;
    font-size: 12px;
}

.ace-pg-otp-copy span {
    color: #777;
    font-size: 11px;
    line-height: 1.5;
}

.ace-pg-signup-message {
    min-height: 0;
    margin-top: 11px;
    color: #666;
    font-size: 11px;
    line-height: 1.5;
}

.ace-pg-signup-message.ace-error { color: #b42318; }
.ace-pg-signup-message.ace-success { color: #217a45; }

.ace-pg-note {
    margin-top: 16px;
    color: #999;
    text-align: center;
    font-size: 10px;
    line-height: 1.5;
}

html.ace-pg-locked,
html.ace-pg-locked body {
    overflow: hidden !important;
}

@media (max-width: 600px) {
    #ace-pg-progress {
        right: 14px;
        bottom: 14px;
        min-width: 0;
    }

    .ace-pg-progress-copy span {
        display: none;
    }

    .ace-pg-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .ace-pg-modal {
        max-width: none;
        max-height: calc(100vh - 24px);
        overflow: auto;
        padding: 29px 22px 24px;
        border-radius: 20px;
    }

    .ace-pg-heading {
        font-size: 29px;
    }

    .ace-pg-actions,
    .ace-pg-form-grid {
        grid-template-columns: 1fr;
    }

    .ace-pg-btn-primary {
        order: -1;
    }
}

/* Keep signup + OTP form elements in proper vertical order */
.ace-pg-quick-form {
    display: flex;
    flex-direction: column;
}

.ace-pg-quick-form .ace-pg-form-field,
.ace-pg-quick-form .ace-pg-form-grid,
.ace-pg-quick-form .ace-pg-otp-copy {
    order: 1;
}

.ace-pg-quick-form .ace-pg-signup-submit {
    order: 10;
    width: 100%;
    margin-top: 16px;
}
