﻿/* ============================================
   BOMBUS - Cadastro de Assinante/Credor
   CSS Isolado (scoped)
   Versão com validação de Chave de Convite
   ============================================ */

/* Container principal - SEGUE PADRÃO DO LOGIN */
.creditor-register {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    box-sizing: border-box;
}

/* Animação de fade-in */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-5px);
    }

    40%, 80% {
        transform: translateX(5px);
    }
}

/* ========== LANDING ========== */

.landing-hero {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.landing-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

    .landing-title .highlight {
        color: #ff8c00;
    }

.landing-subtitle {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.benefits-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

    .benefits-list li {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.65rem 0;
        font-size: 0.9rem;
        color: #333;
    }

        .benefits-list li:not(:last-child) {
            border-bottom: 1px solid #e0e0e0;
        }

.benefit-icon {
    width: 28px;
    height: 28px;
    background: #e8f5e9;
    color: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    font-weight: bold;
}

/* ========== MINI STEPPER (4 steps) ========== */

.mini-stepper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mini-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

    .mini-step.active {
        background: #ff8c00;
        width: 24px;
        border-radius: 4px;
    }

    .mini-step.completed {
        background: #4caf50;
    }

/* ========== FORMULÁRIO ========== */

.form-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.15rem;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .form-label .optional {
        font-weight: 400;
        color: #999;
        text-transform: none;
    }

    .form-label .required {
        color: #ff8c00;
    }

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #999;
    pointer-events: none;
}

.form-input,
::deep .form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

    .form-input:focus,
    ::deep .form-input:focus {
        outline: none;
        border-color: #ff8c00;
        box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    }

    .form-input::placeholder {
        color: #bbb;
    }

    .form-input.error {
        border-color: #c62828;
        animation: shake 0.4s ease;
    }

    /* Input específico para chave de convite */
    .form-input.invitation-key-input {
        font-family: 'Courier New', monospace;
        letter-spacing: 2px;
        text-transform: uppercase;
    }

.form-helper {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.3rem;
    display: block;
}

.validation-error,
::deep .validation-message {
    font-size: 0.7rem;
    color: #c62828;
    margin-top: 0.3rem;
    display: block;
}

/* ========== INFO BOX (explicação da chave) ========== */

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #bbdefb;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.info-box-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.info-box-content {
    flex: 1;
}

.info-box-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0.25rem;
}

.info-box-text {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
}

/* ========== LOADING CARD ========== */

.loading-card {
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}

    .loading-card p {
        margin-top: 1rem;
        color: #666;
        font-size: 0.9rem;
    }

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ========== CREDITOR CARD (credor do convite) ========== */

.creditor-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

    .creditor-card.found {
        border-color: #4caf50;
        background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    }

.creditor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.creditor-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.creditor-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.creditor-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4caf50;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.creditor-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.creditor-fantasia {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.creditor-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.creditor-info-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #666;
}

    .creditor-info-item span:first-child {
        opacity: 0.7;
    }

/* Badge de verificado */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: auto;
}

/* ========== CREDITOR SUMMARY CARD (resumo na etapa CNPJ) ========== */

.creditor-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #c8e6c9;
    border-left: 4px solid #4caf50;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.creditor-summary-icon {
    font-size: 1.25rem;
}

.creditor-summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.creditor-summary-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4caf50;
    font-weight: 600;
}

.creditor-summary-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

/* ========== COMPANY CARD (empresa do assinante) ========== */

.company-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

    .company-card.found {
        border-color: #4caf50;
        background: #e8f5e9;
    }

.company-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.company-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff8c00, #e67e00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.company-card.found .company-avatar {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.company-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.company-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.company-fantasia {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.company-cnpj {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.company-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4caf50;
    font-weight: 600;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.1);
}

    .company-status.inactive {
        color: #ff9800;
    }

    .company-status.pending {
        color: #ff8c00;
    }

.company-address {
    font-size: 0.8rem;
    color: #666;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    line-height: 1.5;
}

/* ========== COMPANY SUMMARY CARD ========== */

.company-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fff8f0 0%, #fff4e6 100%);
    border: 1px solid #ffe0b2;
    border-left: 4px solid #ff8c00;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}

.company-summary-icon {
    font-size: 1.5rem;
}

.company-summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.company-summary-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.company-summary-cnpj {
    font-size: 0.75rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.btn-change {
    background: transparent;
    border: 1px solid #ff8c00;
    color: #ff8c00;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-change:hover {
        background: #ff8c00;
        color: white;
    }

/* ========== SUCCESS CARD ========== */

.success-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid #c8e6c9;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease-out;
}

.success-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.success-message {
    font-size: 0.95rem;
    color: #558b2f;
    line-height: 1.5;
}

.success-spid {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
}

    .success-spid code {
        background: rgba(0,0,0,0.05);
        padding: 0.2rem 0.5rem;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
    }

/* ========== CONNECT SECTION ========== */

.connect-section {
    background: #fff8f0;
    border-left: 4px solid #ff8c00;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.connect-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e67e00;
    margin-bottom: 0.35rem;
}

.connect-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* ========== BANNERS ========== */

.error-banner {
    background: #ffebee;
    color: #c62828;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 1rem 0;
    border-left: 4px solid #c62828;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.error-banner-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.error-banner-content {
    flex: 1;
}

.error-banner-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.error-banner-text {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.4;
}

.warning-banner {
    background: #fff3e0;
    color: #e65100;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border-left: 4px solid #ff9800;
}

/* ========== BOTÕES ========== */

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
    width: 100%;
}

.btn {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-primary {
    background: linear-gradient(135deg, #ff8c00, #e67e00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

    .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
    }

.btn-secondary {
    background: #fff;
    color: #666;
    border: 2px solid #e0e0e0;
}

    .btn-secondary:hover:not(:disabled) {
        border-color: #ff8c00;
        color: #ff8c00;
    }

.btn-link {
    background: none;
    border: none;
    color: #ff8c00;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    font-family: inherit;
    text-align: center;
}

    .btn-link:hover:not(:disabled) {
        text-decoration: underline;
    }

    .btn-link:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ========== SPINNER ========== */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== STEP CONTENT ========== */

.step-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* ========== RESPONSIVIDADE ========== */

@media (max-width: 768px) {
    .creditor-register {
        padding: 1.5rem;
    }

    .btn-group {
        align-items: center;
    }

    .btn {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .creditor-register {
        padding: 1rem;
    }

    .landing-title {
        font-size: 1.2rem;
    }

    .success-icon {
        font-size: 3rem;
    }

    .success-title {
        font-size: 1.15rem;
    }

    .company-summary-card {
        flex-wrap: wrap;
    }

    .btn-change {
        width: 100%;
        margin-top: 0.5rem;
    }

    .creditor-header {
        flex-wrap: wrap;
    }

    .verified-badge {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
