/* WC Reparações — frontend */

.wcr-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px;
}

/* Avisos */
.wcr-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.wcr-notice-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Formulário */
.wcr-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wcr-section h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

.wcr-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.wcr-section input[type="text"],
.wcr-section input[type="email"],
.wcr-section input[type="tel"],
.wcr-section textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.wcr-section input[type="date"],
.wcr-section select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.wcr-required { color: #c00; }

/* Honeypot anti-spam: invisível para humanos, presente para bots */
.wcr-hp {
    position: absolute !important;
    left: -9999px !important;
    height: 1px;
    overflow: hidden;
}

/* Ficheiros no modal de detalhes — só a guarda funcional: uma imagem nunca
 * pode rebentar a largura do modal. Aparência (miniaturas, grelha, tipografia)
 * é personalizável por CSS externo em .wcr-modal-files / .wcr-modal-file. */
.wcr-modal-file img {
    max-width: 100%;
    height: auto;
}

/* Layout do formulário em colunas (atributo colunas="2|3") */
.wcr-form-cols-2, .wcr-form-cols-3 {
    display: grid;
    gap: 0 25px;
    align-items: start;
}
.wcr-form-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wcr-form-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 720px) {
    .wcr-form-cols-2, .wcr-form-cols-3 { grid-template-columns: 1fr; }
}

.wcr-hint {
    font-size: 13.5px;
    color: #666;
    margin-top: -4px;
}

/* Grelha de tipos de problema */
.wcr-problem-hint {
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
}

.wcr-problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 5px;
}

.wcr-problem-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px 10px;
    background: #f7f7f8;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wcr-problem-card svg {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.wcr-problem-card:hover {
    background: #efefef;
    border-color: #d5d5d5;
}

.wcr-problem-card.wcr-selected {
    background: #ff9018;
    border-color: #ff9018;
    color: #1d1d1f;
}

.wcr-problem-card:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .wcr-problem-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wcr-privacy label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 400;
}

/* Botões */
.wcr-btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.wcr-btn:hover { background: #efefef; }

.wcr-btn-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.wcr-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.wcr-btn-danger {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.wcr-btn-danger:hover {
    background: #b32d2e;
    color: #fff;
}

/* Mensagens de feedback */
.wcr-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 4px;
}

.wcr-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wcr-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ------------------------------------------------------------------ *
 * Área de cliente ("Minha Conta > Tickets") — APENAS CSS FUNCIONAL.
 *
 * A aparência desta área é deliberadamente delegada em CSS externo (ex.:
 * Oxygen Builder → Custom CSS) sobre as classes estáveis do template:
 *   .wcr-account-tickets · .wcr-account-tickets-title · .wcr-ticket-list ·
 *   .wcr-ticket-card · .wcr-ticket-header · .wcr-ticket-number ·
 *   .wcr-ticket-status (+ .wcr-badge-{estado}) · .wcr-ticket-meta
 *   (+ -category/-equipment/-date) · .wcr-ticket-quote · .wcr-ticket-actions ·
 *   .wcr-ticket-empty · .wcr-ticket-new · .wcr-modal-content/-header/-body/
 *   -section/-files/-file · .wcr-history-table
 *
 * O que fica aqui é o mínimo sem o qual a página não FUNCIONA:
 * o modal tem de sobrepor a página, ser legível e poder fechar-se.
 * ------------------------------------------------------------------ */

/* Overlay do modal: sobreposição, escurecimento e scroll — sem isto o
 * conteúdo do modal mistura-se com a página. */
#wcr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    overflow-y: auto;
}

/* O atributo [hidden] tem de vencer qualquer display definido externamente. */
#wcr-modal[hidden] { display: none; }

/* Caixa do modal: fundo opaco (legibilidade sobre o overlay), largura contida
 * e scroll próprio. Dimensões substituíveis por CSS externo. */
.wcr-modal-content {
    background: #fff;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 5vh auto;
    position: relative;
}

/* Botão fechar: tem de ficar ancorado ao canto do modal e ser clicável. */
#wcr-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Grelha de categorias ([wc_reparacoes_categorias])
 * ------------------------------------------------------------------ */

.wcr-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.wcr-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 16px;
    border: 2px solid #e3e3e3;
    border-radius: 10px;
    background: #fff;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.wcr-cat-card:hover,
a.wcr-cat-card:focus {
    border-color: #ff9018;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.wcr-cat-card-name { font-size: 17px; font-weight: 700; }
.wcr-cat-card-type { font-size: 12px; color: #777; }

/* Estimativa informativa do serviço (RFC-005) */
.wcr-service-estimate {
    margin: -6px 0 14px;
    padding: 10px 14px;
    background: #f7f7f7;
    border-left: 3px solid #2271b1;
    border-radius: 0 4px 4px 0;
}
.wcr-service-estimate .wcr-estimate-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
}
.wcr-service-estimate .wcr-estimate-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin-top: 2px;
}
.wcr-service-estimate .wcr-estimate-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #646970;
}

/* Formulário de contacto — pacotes e campos dinâmicos (RFC-007, R1.4) */
.wcr-lead-packages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 16px;
}
.wcr-lead-package {
    display: block;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}
.wcr-lead-package:has(input:checked) {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}
.wcr-lead-package input[type="radio"] {
    margin-right: 6px;
}
.wcr-lead-package-price {
    font-weight: 600;
    color: #1d2327;
    margin-left: 6px;
}
.wcr-lead-package small {
    display: block;
    margin-top: 4px;
    color: #646970;
}
.wcr-lead-fields .wcr-cf-help {
    display: block;
    margin-top: 4px;
    color: #646970;
}
.wcr-lead-fields .wcr-cf-group {
    display: block;
}
.wcr-lead-fields .wcr-cf-choice {
    display: block;
    margin: 4px 0;
    font-weight: normal;
}

/* --- v1.16.22: convite a entrar/registar no bloco de submissao --- */
.wcr-auth-gate {
    border: 1px solid #e5e0dd;
    border-radius: 14px;
    padding: 20px 22px;
    background: #faf8f7;
}
.wcr-auth-gate-text {
    margin: 0 0 14px;
    line-height: 1.55;
}
.wcr-auth-gate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px;
}
.wcr-auth-gate-note {
    margin: 0;
    font-size: 13px;
    color: #7a7371;
}
.wcr-btn-secondary {
    background: transparent;
    border: 1px solid #d6d1ce;
    color: #191717;
}
.wcr-btn-secondary:hover {
    border-color: #b3aca9;
}

/* --- v1.16.23: bloco de conta dentro do pedido --- */
.wcr-auth-tabs {
    display: flex;
    gap: 6px;
    margin: 14px 0 16px;
}
.wcr-auth-tab {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid #e5e0dd;
    border-radius: 999px;
    background: #fcfafa;
    color: #6b6664;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 180ms linear, color 180ms linear, border-color 180ms linear;
}
.wcr-auth-tab:hover { border-color: #c9c2bf; }
.wcr-auth-tab.is-active {
    background: #191717;
    border-color: #191717;
    color: #ffffff;
}
.wcr-auth-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #7a7371;
}
.wcr-auth-lost {
    margin-left: 14px;
    font-size: 14px;
    color: #6b6664;
}
.wcr-auth-status {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f2f7f2;
    border: 1px solid #d8e6d8;
    font-size: 15px;
    color: #24502f;
}
.wcr-auth-gate-inline {
    margin: 0;
    font-size: 15px;
    color: #6b6664;
}
