.apb-form {
    max-width: 520px;
    width: 100%;
}

.apb-field {
    margin-bottom: 18px;
}

.apb-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: inherit;
}

.apb-field input:not([type="checkbox"]):not([type="radio"]),
.apb-field textarea,
.apb-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.apb-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.apb-field input:not([type="checkbox"]):not([type="radio"]):focus,
.apb-field textarea:focus,
.apb-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.apb-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.apb-required {
    color: #ef4444;
    margin-left: 2px;
}

.apb-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.5;
}

.apb-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    accent-color: #2563eb;
}

.apb-consent-field {
    color: #6b7280;
    font-size: 13px;
}

.apb-consent-field a {
    color: #2563eb;
    text-decoration: underline;
}

.apb-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.4;
}

.apb-submit:hover {
    background: #1d4ed8;
}

.apb-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.apb-form-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.apb-form-message:not(:empty) {
    display: block;
}

.apb-form-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.apb-form-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.apb-form-success-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    opacity: 0;
    transform: scale(0.95) translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.apb-form-success-overlay-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.apb-form-success-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    animation: apbSuccessCheck 0.6s ease 0.2s both;
}

.apb-form-success-icon svg {
    width: 100%;
    height: 100%;
}

.apb-form-success-icon svg circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: apbCircleDraw 0.5s ease 0.3s forwards;
}

.apb-form-success-icon svg path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: apbCheckDraw 0.35s ease 0.7s forwards;
}

.apb-form-success-msg {
    font-size: 18px;
    font-weight: 600;
    color: #166534;
    margin: 0 0 4px;
    line-height: 1.5;
}

.apb-form-success-extra {
    margin-top: 16px;
}

.apb-form-success-extra:empty {
    display: none;
}

@keyframes apbSuccessCheck {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes apbCircleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes apbCheckDraw {
    to { stroke-dashoffset: 0; }
}

.apb-tel-ext-wrap {
    display: flex;
    gap: 8px;
    width: 100%;
}

.apb-tel-ext-wrap .apb-tel-dialcode {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    border-radius: 6px;
    padding-right: 28px;
    font-size: 14px;
    max-width: 120px;
}

.apb-tel-ext-wrap .apb-tel-number {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 6px;
}

.apb-tel-ext-wrap .apb-tel-dialcode:focus {
    z-index: 1;
    position: relative;
}

.apb-tel-ext-wrap .apb-tel-number:focus {
    z-index: 1;
    position: relative;
}

.apb-tel-ext-detecting .apb-tel-dialcode {
    opacity: 0.6;
    pointer-events: none;
}

.apb-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: inherit;
}

.apb-hint {
    margin-top: 5px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.apb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apb-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 400;
}

.apb-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #2563eb;
}

