/* assets/css/cct-form-widget.css — CCT Form Widget frontend styles */

.ncf-widget {
    box-sizing: border-box;
    font-family: sans-serif;
    padding: 32px;
    background: #ffffff;
    border-radius: 8px;
}

/* Row layout */
.ncf-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.ncf-row:last-of-type {
    margin-bottom: 0;
}

/* Field */
.ncf-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ncf-field--full {
    flex: 1 1 100%;
    width: 100%;
}

.ncf-field--half {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}

/* Label */
.ncf-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.ncf-label .ncf-required {
    color: #a080d8;
    margin-left: 2px;
}

/* Input */
.ncf-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.ncf-input:focus {
    border-color: #6EC1E4;
    box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.15);
}

.ncf-input::placeholder {
    color: #9ca3af;
}

.ncf-input.ncf-input--error {
    border-color: #ef4444;
}

/* Submit button */
.ncf-submit {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #6EC1E4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    box-sizing: border-box;
}

.ncf-submit:hover {
    background: #5eb0d3;
}

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

.ncf-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.ncf-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ncf-spin 0.7s linear infinite;
}

/* Message */
.ncf-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.ncf-message.show {
    display: block;
}

.ncf-message--success {
    background: #A080D8;
    color: #1e1e1e;
    border: 1px solid #A080D8;
}

.ncf-message--error {
    background: #A080D8;
    color: #1e1e1e;
    border: 1px solid #A080D8;
}

.ncf-message--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Already-submitted notice */
.ncf-submitted-notice {
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 14px;
    color: #166534;
    margin-bottom: 16px;
}

/* Shake animation (same keyframes as auth widget) */
@keyframes ncf-shake {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-7px); }
    30%  { transform: translateX(7px); }
    45%  { transform: translateX(-5px); }
    60%  { transform: translateX(5px); }
    75%  { transform: translateX(-3px); }
    90%  { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.ncf-message.ncf-shake {
    animation: ncf-shake 0.45s ease-in-out;
}

@keyframes ncf-spin {
    to { transform: rotate(360deg); }
}

/* Location autocomplete */
.ncf-location-wrap {
    position: relative;
}

.ncf-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
}

.ncf-ac-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.ncf-ac-item:last-child {
    border-bottom: none;
}

.ncf-ac-item:hover,
.ncf-ac-item.ncf-ac-active {
    background: #f3f4f6;
    color: #111827;
}

.ncf-ac-loading,
.ncf-ac-empty {
    padding: 10px 14px;
    font-size: 14px;
    color: #9ca3af;
}

/* ── Gift section ──────────────────────────────────────────────────────────── */

.ncf-gift-section {
    margin-top: 20px;
    text-align: center;
}

.ncf-gift-toggle {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px;
    font-size: 13px;
    color: #9ca3af;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.ncf-gift-toggle:hover {
    color: #6b7280;
    background: #f9fafb;
    border-color: #d1d5db;
}

.ncf-gift-form-wrap {
    margin-top: 16px;
    text-align: left;
}

.ncf-gift-back {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 14px;
    padding: 8px 16px;
    font-size: 13px;
    color: #9ca3af;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.ncf-gift-back:hover {
    color: #6b7280;
    background: #f9fafb;
    border-color: #d1d5db;
}

.ncf-gift-email-label {
    display: block;
    margin-bottom: 6px;
}

.ncf-gift-msg {
    margin-top: 10px;
    font-size: 13px;
    display: none;
}

.ncf-gift-msg.error { color: #ef4444; }
.ncf-gift-msg.ok    { color: #16a34a; }

.ncf-gift-result {
    margin-top: 16px;
    text-align: center;
}

.ncf-gift-sent {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

/* ── Gift code display (view + result) ─────────────────────────────────────── */

.ncf-gift-view {
    text-align: center;
    padding: 8px 0;
}

.ncf-gift-waiting {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.ncf-gift-code-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ncf-gift-code {
    font-family: monospace;
    font-size: 15px;
    letter-spacing: 1px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 14px;
    color: #111827;
    word-break: break-all;
}

.ncf-copy-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.ncf-copy-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Responsive: stack halves below 480px */
@media (max-width: 480px) {
    .ncf-row {
        flex-wrap: wrap;
    }
    .ncf-field--half {
        flex: 1 1 100%;
    }
}
