/* UB Gold Application Form – Professional, white panel, brand accent #8b500e */

.ubga-form-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 32px 36px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1a1a1a;
    line-height: 1.55;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e4df;
}

/* Progress */
.ubga-progress {
    margin-bottom: 2rem;
}
.ubga-progress-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}
.ubga-progress-item {
    flex: 1 1 0;
    min-width: 110px;
    text-align: center;
    padding: 12px 8px;
    background: #f5f3f0;
    border-radius: 6px;
    color: #6b6560;
    transition: background 0.2s, color 0.2s;
    border: 1px solid #e8e4df;
}
.ubga-progress-item.active {
    background: #8b500e;
    color: #ffffff;
    border-color: #8b500e;
}
.ubga-progress-item.completed {
    background: #8b500e;
    color: #ffffff;
    border-color: #8b500e;
    opacity: 0.92;
}
.ubga-step-num {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
}
.ubga-step-label {
    display: block;
    font-size: 0.72rem;
    margin-top: 3px;
    line-height: 1.3;
}

/* Steps */
.ubga-step {
    display: none;
    animation: ubgaFade 0.25s ease;
}
.ubga-step.active {
    display: block;
}
@keyframes ubgaFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ubga-step h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
    font-weight: 650;
    color: #1a1a1a;
    border-bottom: 2px solid #e8e4df;
    padding-bottom: 0.6rem;
}

.ubga-step h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
    color: #1a1a1a;
}

/* Guide */
.ubga-guide-list {
    padding-left: 1.25rem;
}
.ubga-guide-list li {
    margin-bottom: 0.4rem;
}
.ubga-note {
    background: #faf8f5;
    border-left: 4px solid #8b500e;
    padding: 12px 16px;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

/* Declaration */
.ubga-declaration {
    background: #faf8f5;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.ubga-declaration ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

/* Fields */
.ubga-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}
.ubga-field {
    display: flex;
    flex-direction: column;
}
.ubga-field.ubga-full {
    grid-column: 1 / -1;
}
.ubga-field label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #2c2c2c;
}
.ubga-req {
    color: #8b500e;
    font-weight: 700;
}
.ubga-field input[type="text"],
.ubga-field input[type="email"],
.ubga-field input[type="tel"],
.ubga-field input[type="date"],
.ubga-field select,
.ubga-field textarea {
    padding: 0.65rem 0.8rem;
    border: 1px solid #d0cbc4;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ubga-field input:focus,
.ubga-field select:focus,
.ubga-field textarea:focus {
    outline: none;
    border-color: #8b500e;
    box-shadow: 0 0 0 3px rgba(139, 80, 14, 0.18);
}
.ubga-field input.ubga-invalid,
.ubga-field select.ubga-invalid,
.ubga-field textarea.ubga-invalid {
    border-color: #b42318;
}
.ubga-error {
    color: #b42318;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    min-height: 1.1em;
}
.ubga-checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-weight: 500;
    cursor: pointer;
}
.ubga-checkbox-field input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: #8b500e;
}

/* Signature */
.ubga-signature-section {
    margin: 1.5rem 0;
}
.ubga-signature-pad-wrap {
    border: 2px dashed #c4b8a8;
    border-radius: 6px;
    background: #fff;
    touch-action: none;
    max-width: 100%;
    overflow: hidden;
}
#ubga-signature-pad {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    cursor: crosshair;
}
.ubga-signature-controls {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
/* Signature timestamp (read-only) */
.ubga-signature-timestamp {
    margin-top: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: #faf8f5;
    border: 1px solid #e8e4df;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #3d3429;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    align-items: baseline;
}
.ubga-signature-timestamp .ubga-ts-label {
    font-weight: 600;
    color: #5c564e;
}
.ubga-signature-timestamp .ubga-ts-value {
    font-variant-numeric: tabular-nums;
    color: #1a1a1a;
}


/* File list */
.ubga-file-list {
    margin-top: 0.5rem;
}
.ubga-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: #faf8f5;
    border: 1px solid #e8e4df;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}
.ubga-file-item button {
    margin-left: auto;
    background: none;
    border: none;
    color: #b42318;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 4px;
}

/* Navigation buttons */
.ubga-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e4df;
}
.ubga-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.ubga-btn:focus-visible {
    outline: 3px solid rgba(139, 80, 14, 0.45);
    outline-offset: 2px;
}
.ubga-btn-next,
.ubga-btn-submit {
    background: #8b500e;
    color: #ffffff;
    margin-left: auto;
}
.ubga-btn-next:hover,
.ubga-btn-submit:hover {
    background: #6e3f0b;
}
.ubga-btn-prev {
    background: #8b500e;
    color: #ffffff;
}
.ubga-btn-prev:hover {
    background: #6e3f0b;
}
.ubga-btn-secondary {
    background: #f0ebe4;
    color: #3d3429;
    border: 1px solid #d0cbc4;
}
.ubga-btn-secondary:hover {
    background: #e5ddd3;
}
.ubga-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Messages / Success panel */
.ubga-messages {
    margin-top: 0.5rem;
}
.ubga-messages.success {
    display: block !important;
}
.ubga-messages[hidden] {
    display: none !important;
}
.ubga-messages.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #7f1d1d;
    padding: 1.25rem;
    border-radius: 6px;
}
.ubga-success-panel {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #ffffff;
}
.ubga-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: #8b500e;
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    line-height: 64px;
}
.ubga-success-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    color: #1a1a1a;
    border: none;
    padding: 0;
}
.ubga-success-panel p {
    margin: 0.4rem 0;
    color: #444;
}
.ubga-ref-label {
    margin-top: 1.5rem !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b6560 !important;
}
.ubga-ref {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #8b500e !important;
    letter-spacing: 0.02em;
    margin: 0.25rem 0 1rem !important;
}
.ubga-retain {
    font-size: 0.95rem;
}
.ubga-not-approved {
    font-size: 0.88rem;
    color: #6b6560 !important;
    margin-bottom: 1.75rem !important;
}
.ubga-countdown {
    margin-top: 1.25rem !important;
    font-size: 0.9rem;
    color: #6b6560 !important;
}
.ubga-success-panel .ubga-btn-submit {
    margin: 0.5rem auto 0;
}

/* Help text */
.ubga-help {
    font-size: 0.9rem;
    color: #5c564e;
    margin: 0.25rem 0 0.75rem;
}

.ubga-docs-heading {
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 700px) {
    .ubga-form-wrapper {
        padding: 18px 16px 28px;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
    .ubga-grid {
        grid-template-columns: 1fr;
    }
    .ubga-progress-item {
        min-width: 70px;
        padding: 8px 4px;
    }
    .ubga-step-label {
        font-size: 0.62rem;
    }
    .ubga-nav {
        flex-direction: column-reverse;
    }
    .ubga-btn {
        width: 100%;
        margin-left: 0;
    }
    .ubga-btn-next,
    .ubga-btn-submit {
        margin-left: 0;
    }
}
