/* Netia Coverage Checker — Frontend Styles */

/* ===== Variables ===== */
:root {
    --ncc-primary:    #1a2744;
    --ncc-bg:         #ffffff;
    --ncc-border:     #d0d5e0;
    --ncc-border-focus: #1a2744;
    --ncc-placeholder: #9ba3b4;
    --ncc-radius:     8px;
    --ncc-transition: 0.2s ease;
}

/* ===== Wrapper ===== */
.ncc-wrapper {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ncc-primary);
    box-sizing: border-box;
}

.ncc-wrapper *,
.ncc-wrapper *::before,
.ncc-wrapper *::after {
    box-sizing: inherit;
}

/* ===== Form ===== */
.ncc-form {
    background: var(--ncc-bg);
    padding: 32px;
    border-radius: var(--ncc-radius);
    box-shadow: 0 4px 24px rgba(26, 39, 68, 0.08);
}

.ncc-field-group {
    margin-bottom: 24px;
    position: relative;
}

.ncc-row {
    display: flex;
    gap: 16px;
}

.ncc-field-half {
    flex: 1;
    min-width: 0;
}

/* ===== Labels ===== */
.ncc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ncc-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ncc-required {
    color: #e74c3c;
    margin-left: 2px;
}

.ncc-optional {
    font-weight: 400;
    font-size: 11px;
    color: var(--ncc-placeholder);
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== Inputs ===== */
.ncc-input {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: var(--ncc-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--ncc-border);
    border-radius: 0;
    outline: none;
    transition: border-color var(--ncc-transition);
    -webkit-appearance: none;
    appearance: none;
}

.ncc-input::placeholder {
    color: var(--ncc-placeholder);
}

.ncc-input:focus {
    border-bottom-color: var(--ncc-border-focus);
}

.ncc-input:disabled {
    color: var(--ncc-placeholder);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== Autocomplete ===== */
.ncc-autocomplete-wrap {
    position: relative;
}

.ncc-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--ncc-bg);
    border: 1px solid var(--ncc-border);
    border-radius: var(--ncc-radius);
    box-shadow: 0 8px 24px rgba(26, 39, 68, 0.12);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
}

.ncc-dropdown[hidden] {
    display: none;
}

.ncc-dropdown li {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    color: var(--ncc-primary);
    transition: background var(--ncc-transition);
}

.ncc-dropdown li:hover,
.ncc-dropdown li[aria-selected="true"] {
    background: #f0f3fa;
}

/* ===== Submit button ===== */
.ncc-submit-wrap {
    margin-top: 8px;
}

.ncc-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 32px;
    background: var(--ncc-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: opacity var(--ncc-transition), transform var(--ncc-transition);
    position: relative;
    overflow: hidden;
}

.ncc-btn-submit:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
}

.ncc-btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.ncc-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner */
.ncc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ncc-spin 0.7s linear infinite;
}

.ncc-btn-submit.ncc-loading .ncc-spinner {
    display: inline-block;
}

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

/* ===== Error message ===== */
.ncc-error-msg {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.ncc-error-msg.ncc-visible {
    display: block;
}

/* ===== Modal backdrop ===== */
.ncc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 39, 68, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ncc-fade-in 0.2s ease;
}

.ncc-modal-backdrop[hidden] {
    display: none;
}

@keyframes ncc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== Modal ===== */
.ncc-modal-backdrop .modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.13);
    animation: ncc-slide-up 0.25s ease;
}

@keyframes ncc-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.ncc-modal-backdrop .modal[hidden] {
    display: none;
}

/* Modal header */
.ncc-modal-backdrop .modal-header {
    padding: 36px 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.ncc-modal-backdrop .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: opacity var(--ncc-transition);
}

.ncc-modal-backdrop .close-btn:hover {
    opacity: 0.75;
}

.ncc-modal-backdrop .close-btn svg {
    width: 10px;
    height: 10px;
    stroke: #1a3a6b;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.ncc-modal-backdrop .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ncc-modal-backdrop .icon-circle svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ncc-modal-backdrop .modal-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.ncc-modal-backdrop .address-pill {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal body */
.ncc-modal-backdrop .modal-body {
    padding: 28px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ncc-modal-backdrop .modal-body p {
    font-size: 15px;
    color: #444;
    line-height: 1.65;
    text-align: center;
    margin: 0;
}

.ncc-modal-backdrop .modal-body p strong {
    color: #1a3a6b;
    font-weight: 600;
}

/* CTA buttons */
.ncc-modal-backdrop .cta-primary {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 50px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    letter-spacing: .2px;
    transition: opacity var(--ncc-transition), transform var(--ncc-transition);
}

.ncc-modal-backdrop .cta-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none;
}

.ncc-modal-backdrop .cta-success {
    background: #2ecc71;
    color: #fff;
}

.ncc-modal-backdrop .cta-navy {
    background: #1a3a6b;
    color: #fff;
}

.ncc-modal-backdrop .cta-secondary {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 50px;
    border: 2px solid #1a3a6b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: #1a3a6b;
    background: transparent;
    transition: opacity var(--ncc-transition);
}

.ncc-modal-backdrop .cta-secondary:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* Divider */
.ncc-modal-backdrop .divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbb;
    font-size: 12px;
    margin: 4px 0;
}

.ncc-modal-backdrop .divider::before,
.ncc-modal-backdrop .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .ncc-form {
        padding: 20px 16px;
    }

    .ncc-row {
        flex-direction: column;
        gap: 0;
    }

    .ncc-modal-backdrop .modal-header {
        padding: 28px 20px 20px;
    }

    .ncc-modal-backdrop .modal-body {
        padding: 20px 20px 24px;
    }
}
