/* Custom Contact Form – form.css (Dark Theme Edition) */

/* ซ่อน p tag ที่ theme inject เข้ามา */
.ccf-wrapper p,
.ccf-card p,
#ccf-form p {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}

.ccf-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, 'Sarabun', BlinkMacSystemFont, sans-serif;
}

.ccf-card {
    background: var(--ccf-card-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--ccf-card-border, rgba(255,255,255,0.12));
    border-radius: 16px;
    padding: 32px 28px;
}

.ccf-form-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.3;
}

.ccf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .ccf-row { grid-template-columns: 1fr; }
    .ccf-card { padding: 16px 12px; }
}

.ccf-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    margin-top: 0;
}

/* Default label */
.ccf-field label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    color: #ffffff !important;
    display: block;
    line-height: 1.3;
}

/* Pill style */
.ccf-style-pill .ccf-field label {
    display: inline-block;
    background: var(--ccf-label-bg, rgba(255,255,255,0.12));
    color: var(--ccf-label-color, #fff);
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Underline style */
.ccf-style-underline .ccf-field label {
    color: var(--ccf-label-color, #e0e0e0);
    border-bottom: 2px solid var(--ccf-accent, #1a73e8);
    padding-bottom: 5px;
    margin-bottom: 10px;
    display: block;
    width: fit-content;
}

/* Box/tag style */
.ccf-style-box .ccf-field label {
    background: var(--ccf-label-bg, rgba(255,255,255,0.10));
    color: var(--ccf-label-color, #fff);
    padding: 4px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
    font-size: 13px;
}

/* Glow style */
.ccf-style-glow .ccf-field label {
    color: var(--ccf-label-color, #90caf9);
    text-shadow: 0 0 8px var(--ccf-accent-glow, rgba(26,115,232,0.7));
    font-size: 14px;
    margin-bottom: 7px;
    display: block;
}

.ccf-req { color: #ff6b6b; margin-left: 2px; }

.ccf-field input,
.ccf-field textarea {
    border: 1.5px solid var(--ccf-input-border, rgba(255,255,255,0.18));
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ccf-input-color, #fff);
    background: var(--ccf-input-bg, rgba(255,255,255,0.07));
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.ccf-field input::placeholder,
.ccf-field textarea::placeholder {
    color: var(--ccf-placeholder-color, rgba(255,255,255,0.32));
}

.ccf-field input:focus,
.ccf-field textarea:focus {
    border-color: var(--ccf-accent, #1a73e8);
    box-shadow: 0 0 0 3px var(--ccf-accent-glow, rgba(26,115,232,0.22));
    background: var(--ccf-input-bg-focus, rgba(255,255,255,0.10));
}

.ccf-field input.ccf-invalid,
.ccf-field textarea.ccf-invalid {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255,107,107,0.2);
}

.ccf-field textarea { resize: vertical; min-height: 90px; }

.ccf-error { font-size: 12px; color: #ff6b6b; margin-top: 2px; min-height: 0; }

.ccf-submit-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.ccf-btn {
    background: var(--ccf-btn-bg, #1a73e8);
    color: var(--ccf-btn-color, #fff);
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
}

.ccf-btn:hover {
    background: var(--ccf-btn-hover, #1558b0);
    box-shadow: 0 4px 18px var(--ccf-accent-glow, rgba(26,115,232,0.4));
}

.ccf-btn:active { transform: scale(.98); }
.ccf-btn:disabled { background: #444; color: #888; cursor: not-allowed; box-shadow: none; }

.ccf-spinner { font-size: 14px; color: rgba(255,255,255,0.45); display: none; }

.ccf-alert-error {
    background: rgba(255,107,107,0.1);
    border: 1px solid rgba(255,107,107,0.3);
    color: #ffaaaa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 14px;
}

.ccf-success { text-align: center; padding: 40px 20px; }

.ccf-success-icon {
    width: 64px;
    height: 64px;
    background: rgba(76,175,80,0.12);
    color: #69f0ae;
    border: 2px solid rgba(76,175,80,0.35);
    border-radius: 50%;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ccf-success p {
    font-size: 17px;
    color: var(--ccf-label-color, #e0e0e0);
    line-height: 1.6;
}
