@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ct-bg-page: #f8fafc;
    --ct-bg-card: #ffffff;
    --ct-text-main: #0f172a;
    --ct-text-muted: #475569;
    --ct-text-subtle: #64748b;
    --ct-placeholder: #334155;
    --ct-border: #cbd5e1;
    --ct-border-hover: #94a3b8;
    --ct-primary: #16a34a;
    --ct-primary-hover: #15803d;
    --ct-primary-light: #f0fdf4;
    --ct-primary-border: #bbf7d0;
    --ct-focus-ring: rgba(22, 163, 74, 0.18);
    --ct-error-bg: #fef2f2;
    --ct-error-text: #991b1b;
    --ct-error-border: #fecaca;
    --ct-font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    background: var(--ct-bg-page);
    color: var(--ct-text-main);
    font-family: var(--ct-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* =========================================
   TOP BAR (MOBILE COMPATIBLE HEADER)
========================================= */

.ct-topbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ct-topbar-inner {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
}

.ct-topbar-brand {
    display: flex;
    align-items: center;
}

.ct-topbar-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ct-topbar-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ct-topbar-logo-web {
    height: 38px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}


/* =========================================
   MAIN PAGE & CARD WRAPPER
========================================= */

.ct-registration-page {
    width: 100%;
    min-height: calc(100vh - 67px);
    background: linear-gradient(145deg, #f8fafc 0%, #edf2f7 100%);
    padding: 40px 20px 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ct-registration-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--ct-bg-card);
    padding: 48px 44px;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 
        0 10px 25px -5px rgba(15, 23, 42, 0.04),
        0 20px 48px -12px rgba(15, 23, 42, 0.08);
}


/* =========================================
   HEADER ROW (LOGO LEFT, TITLE RIGHT)
========================================= */

.ct-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ct-border);
}

.ct-brand-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ct-brand-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.ct-brand-logo:hover {
    transform: scale(1.03);
}

.ct-header-right {
    flex: 1;
    text-align: right;
}

.ct-registration-title {
    margin-bottom: 0;
    text-align: right;
    font-size: 38px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--ct-text-main);
    letter-spacing: -0.025em;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.ct-registration-title span {
    color: var(--ct-primary);
}

.ct-registration-title .ct-title-sep {
    color: var(--ct-text-subtle);
    font-weight: 500;
    margin: 0 4px;
}


/* =========================================
   AJAX RESPONSE BANNER
========================================= */

.ct-response {
    width: 100%;
    margin-bottom: 25px;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.ct-response.error,
.ct-response.ct-error {
    color: var(--ct-error-text);
    background: var(--ct-error-bg);
    border: 1px solid var(--ct-error-border);
}

.ct-response.success,
.ct-response.ct-success {
    color: #166534;
    background: var(--ct-primary-light);
    border: 1px solid var(--ct-primary-border);
}


/* =========================================
   FORM GRID
========================================= */

.ct-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ct-field {
    width: 100%;
}

.ct-field-title {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ct-text-muted);
    line-height: 1.45;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.ct-field-title .ct-title-sep {
    color: #94a3b8;
    font-weight: 400;
    margin: 0 4px;
}

.ct-field-title .ct-req {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
}

.ct-full {
    grid-column: 1 / -1;
}


/* =========================================
   INPUT / TEXTAREA
========================================= */

.ct-control {
    width: 100%;
    min-height: 58px;
    padding: 0 18px;

    background: #ffffff;
    color: var(--ct-text-main);

    border: 1.5px solid var(--ct-border);
    border-radius: 14px;

    outline: none;

    font-family: var(--ct-font);
    font-size: 16px;
    font-weight: 500;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.ct-control:hover {
    border-color: var(--ct-border-hover);
}

select.ct-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 18px 18px;
    padding-right: 48px;
    line-height: normal;
}

select.ct-control:required:invalid,
select.ct-control.ct-is-placeholder {
    color: var(--ct-placeholder);
}

select.ct-control option {
    color: var(--ct-text-main);
    background-color: #ffffff;
    font-size: 15px;
    padding: 10px 14px;
}

select.ct-control option:first-child {
    color: var(--ct-placeholder);
}


/* =========================================
   PLACEHOLDER (DARKER & CRISP)
========================================= */

.ct-control::placeholder {
    color: var(--ct-placeholder);
    opacity: 1;
    font-weight: 500;
}

.ct-control::-webkit-input-placeholder {
    color: var(--ct-placeholder);
    opacity: 1;
    font-weight: 500;
}

.ct-control::-moz-placeholder {
    color: var(--ct-placeholder);
    opacity: 1;
    font-weight: 500;
}

.ct-control:-ms-input-placeholder {
    color: var(--ct-placeholder);
    opacity: 1;
    font-weight: 500;
}


/* =========================================
   FIELD FOCUS
========================================= */

.ct-control:focus {
    outline: none;
    border-color: var(--ct-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--ct-focus-ring);
}


/* =========================================
   TEXTAREA & PROBLEM DESCRIPTION
========================================= */

.ct-textarea-container {
    position: relative;
    width: 100%;
}

.ct-textarea {
    min-height: 110px;
    padding-top: 14px;
    padding-bottom: 14px;
    resize: vertical;
    line-height: 1.55;
}

/* Darker placeholder for problem description textarea */
.ct-control.ct-dark-placeholder::placeholder,
#problem_description::placeholder {
    color: #334155;
    opacity: 1;
    font-weight: 450;
}

.ct-control.ct-dark-placeholder::-webkit-input-placeholder,
#problem_description::-webkit-input-placeholder {
    color: #334155;
    opacity: 1;
    font-weight: 450;
}

.ct-control.ct-dark-placeholder::-moz-placeholder,
#problem_description::-moz-placeholder {
    color: #334155;
    opacity: 1;
    font-weight: 450;
}

.ct-control.ct-dark-placeholder:-ms-input-placeholder,
#problem_description:-ms-input-placeholder {
    color: #334155;
    opacity: 1;
    font-weight: 450;
}

.ct-char-counter {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ct-text-subtle);
}

#problem_description_wrapper {
    animation: ctDescFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ctDescFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================
   FEE BOX
========================================= */

.ct-fee-box {
    width: 100%;
    margin-top: 28px;
    padding: 22px 24px;

    background: var(--ct-primary-light);
    border: 1.5px solid var(--ct-primary-border);
    border-radius: 16px;

    text-align: center;
}

.ct-fee-title {
    margin-bottom: 6px;
    color: var(--ct-text-muted);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ct-fee-amount {
    color: var(--ct-primary);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.01em;
}


/* =========================================
   CONFIRMATION CHECKBOX
========================================= */

.ct-confirm {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
}

.ct-confirm input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--ct-primary);
    cursor: pointer;
}

.ct-confirm label {
    color: var(--ct-text-muted);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}


/* =========================================
   SUBMIT BUTTON
========================================= */

.ct-submit-row {
    width: 100%;
    margin-top: 28px;
}

.ct-submit-btn {
    width: 100%;
    min-height: 58px;

    border: none;
    border-radius: 14px;

    background: var(--ct-primary);
    color: #ffffff;

    font-family: var(--ct-font);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;

    cursor: pointer;

    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.28);

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.ct-submit-btn:hover {
    background: var(--ct-primary-hover);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.38);
    transform: translateY(-1px);
}

.ct-submit-btn:active {
    transform: translateY(0);
}

.ct-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* =========================================
   SUCCESS BOX
========================================= */

.ct-registration-success {
    width: 100%;
    padding: 48px 30px;
    background: #ffffff;
    border: 1.5px solid var(--ct-primary-border);
    border-radius: 20px;
    text-align: center;
}

.ct-success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ct-primary);
    color: #ffffff;
    font-size: 34px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
}

.ct-registration-success h2 {
    margin-bottom: 10px;
    color: var(--ct-text-main);
    font-size: 26px;
    font-weight: 700;
}

.ct-registration-success p {
    color: var(--ct-text-subtle);
    font-size: 16px;
    line-height: 1.6;
}


/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 768px) {
    .ct-topbar-inner {
        padding: 10px 16px;
    }

    .ct-topbar-logo-web {
        height: 30px;
        max-width: 175px;
    }

    .ct-registration-page {
        padding: 20px 14px 36px;
        min-height: calc(100vh - 55px);
    }

    .ct-registration-wrapper {
        padding: 28px 18px;
        border-radius: 18px;
    }

    .ct-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 20px;
    }

    .ct-brand-left {
        justify-content: center;
    }

    .ct-brand-logo {
        width: 100px;
        height: 100px;
    }

    .ct-header-right {
        text-align: center;
        width: 100%;
    }

    .ct-registration-title {
        text-align: center;
        font-size: 26px;
        line-height: 1.35;
        white-space: normal;
        overflow-wrap: break-word;
    }

    .ct-field-title {
        font-size: 14px;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .ct-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ct-full {
        grid-column: auto;
    }

    .ct-control {
        min-height: 54px;
        font-size: 15px;
        border-radius: 12px;
    }

    .ct-textarea {
        min-height: 120px;
    }

    .ct-fee-box {
        margin-top: 22px;
        padding: 18px 20px;
    }

    .ct-fee-amount {
        font-size: 28px;
    }

    .ct-submit-btn {
        min-height: 54px;
        font-size: 16px;
    }

    .ct-registration-success {
        padding: 36px 18px;
    }

    .ct-registration-success h2 {
        font-size: 22px;
    }

    .ct-modal-content {
        padding: 30px 20px 22px;
        border-radius: 18px;
    }

    .ct-modal-title {
        font-size: 20px;
    }

    .ct-modal-message {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ct-topbar-inner {
        padding: 8px 12px;
    }

    .ct-topbar-logo-web {
        height: 25px;
        max-width: 145px;
    }

    .ct-registration-title {
        font-size: 22px;
    }

    .ct-brand-logo {
        width: 85px;
        height: 85px;
    }

    .ct-field-title {
        font-size: 13.5px;
    }
}


/* =========================================
   POPUP MODAL (THEME-MATCHED)
========================================= */

.ct-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ct-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ct-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ct-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    z-index: 2;
    transform: scale(0.92) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ct-modal.is-active .ct-modal-dialog {
    transform: scale(1) translateY(0);
}

.ct-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 34px 28px 26px;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 
        0 20px 35px -10px rgba(15, 23, 42, 0.15),
        0 0 1px 1px rgba(15, 23, 42, 0.05);
}

.ct-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ct-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}

.ct-modal-icon-wrap {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-modal-icon-wrap.ct-modal-error {
    background: #fef2f2;
    color: #ef4444;
    border: 1.5px solid #fee2e2;
}

.ct-modal-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--ct-text-main);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.ct-modal-message {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ct-text-muted);
    margin-bottom: 24px;
}

.ct-modal-actions {
    display: flex;
    justify-content: center;
}

.ct-modal-btn {
    min-width: 125px;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    background: var(--ct-primary);
    color: #ffffff;
    font-family: var(--ct-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ct-modal-btn:hover {
    background: var(--ct-primary-hover);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

.ct-modal-btn:active {
    transform: translateY(0);
}