/**
 * AVP B2B Module - Frontend Styles
 * Brand Colors: Blue Theme
 */

/* ===========================================
   VARIABLES - Brand Colors
   =========================================== */
:root {
    --b2b-primary: #0F70B7;
    --b2b-primary-hover: #0D63A1;
    --b2b-primary-soft: #D4E5F2;
    --b2b-secondary: #2EAAE2;
    --b2b-secondary-dark: #217AA3;
    --b2b-secondary-soft: #D9F0FA;
    --b2b-accent: #FED600;
    --b2b-accent-hover: #E5C100;
    --b2b-accent-soft: #FFF8D1;
    --b2b-text: #052740;
    --b2b-text-muted: #8E9EA9;
    --b2b-border: #CAE0EF;
    --b2b-surface: #E7F1F8;
    --b2b-bg: #FFFFFF;
    --b2b-gradient: linear-gradient(90deg, #0F70B7 0%, #2EAAE2 100%);
    --b2b-success: #22c55e;
    --b2b-error: #ef4444;
}

/* ===========================================
   BASE
   =========================================== */
.b2b-registration {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

#module-avpb2b-registration .page-header {
    display: none;
}

/* ===========================================
   HERO SECTION
   =========================================== */
.b2b-hero {
    text-align: center;
    padding: 40px 20px;
    background: var(--b2b-gradient);
    border-radius: 16px;
    color: white;
    margin-bottom: 30px;
}

.b2b-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.b2b-hero-icon svg {
    stroke: white;
}

.b2b-hero h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
}

.b2b-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    max-width: 500px;
    margin: 0 auto;
}

/* ===========================================
   BENEFITS BAR
   =========================================== */
.b2b-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px 0 30px;
    border-bottom: 1px solid var(--b2b-border);
    margin-bottom: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--b2b-surface);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: var(--b2b-text);
}

.benefit-icon {
    font-size: 18px;
}

/* ===========================================
   ALERTS
   =========================================== */
.b2b-alert {
    display: flex;
    gap: 15px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.b2b-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--b2b-error);
}

.b2b-alert-error svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.b2b-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.b2b-alert li {
    margin: 4px 0;
}

/* ===========================================
   PROGRESS STEPS
   =========================================== */
.b2b-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 20px 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--b2b-border);
    color: var(--b2b-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--b2b-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(15, 112, 183, 0.4);
}

.step-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--b2b-text-muted);
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--b2b-primary);
    font-weight: 600;
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--b2b-border);
    margin: 0 10px;
    margin-bottom: 25px;
}

/* ===========================================
   FORM SECTIONS
   =========================================== */
.form-section {
    background: var(--b2b-bg);
    border: 1px solid var(--b2b-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--b2b-surface);
}

.section-icon {
    font-size: 32px;
    line-height: 1;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--b2b-text);
    margin: 0 0 5px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin: 0;
}

/* ===========================================
   FORM GRID & INPUTS
   =========================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-wide {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--b2b-text);
    margin-bottom: 8px;
}

.required {
    color: var(--b2b-error);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--b2b-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--b2b-text);
    transition: all 0.2s ease;
    background: var(--b2b-surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--b2b-primary);
    background: var(--b2b-bg);
    box-shadow: 0 0 0 4px var(--b2b-primary-soft);
}

.form-input::placeholder {
    color: var(--b2b-text-muted);
}

.form-hint {
    font-size: 12px;
    color: var(--b2b-text-muted);
    margin-top: 6px;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--b2b-text-muted);
}

.password-toggle:hover {
    color: var(--b2b-text);
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
}

.form-select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238E9EA9' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* ===========================================
   LOGGED USER CARD
   =========================================== */
.logged-user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--b2b-secondary-soft);
    border: 1px solid var(--b2b-secondary);
    border-radius: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--b2b-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info strong {
    font-size: 16px;
    color: var(--b2b-secondary-dark);
}

.user-info span {
    font-size: 14px;
    color: var(--b2b-secondary-dark);
}

.user-badge {
    background: var(--b2b-success);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ===========================================
   UPLOAD ZONE
   =========================================== */
.upload-zone {
    border: 2px dashed var(--b2b-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--b2b-surface);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--b2b-primary);
    background: var(--b2b-primary-soft);
}

.upload-input {
    display: none;
}

.upload-icon {
    margin-bottom: 15px;
    color: var(--b2b-text-muted);
}

.upload-text {
    font-size: 16px;
    color: var(--b2b-text);
    margin: 0 0 8px;
}

.upload-text span {
    color: var(--b2b-primary);
    font-weight: 600;
}

.upload-hint {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin: 0;
}

/* File List */
.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--b2b-surface);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-icon {
    font-size: 18px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--b2b-text);
}

.file-size {
    font-size: 12px;
    color: var(--b2b-text-muted);
}

/* Document Suggestions */
.document-suggestions {
    margin-top: 25px;
    padding: 20px;
    background: var(--b2b-accent-soft);
    border: 1px solid var(--b2b-accent);
    border-radius: 10px;
}

.document-suggestions p {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--b2b-text);
}

.document-suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.document-suggestions li {
    font-size: 13px;
    color: var(--b2b-text);
    margin: 5px 0;
}

/* ===========================================
   TERMS SECTION
   =========================================== */
.terms-section {
    padding: 20px 30px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 15px;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--b2b-border);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked+.checkbox-custom {
    background: var(--b2b-gradient);
    border-color: var(--b2b-primary);
}

.checkbox-wrapper input:checked+.checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: var(--b2b-text);
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--b2b-primary);
    text-decoration: underline;
}

/* ===========================================
   NAVIGATION BUTTONS
   =========================================== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.btn-back,
.btn-next,
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-back {
    background: var(--b2b-surface);
    color: var(--b2b-text);
}

.btn-back:hover {
    background: var(--b2b-border);
}

.btn-next {
    background: var(--b2b-gradient);
    color: white;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(15, 112, 183, 0.4);
}

.btn-submit {
    background: var(--b2b-success);
    color: white;
    padding: 16px 32px;
    font-size: 16px;
}

.btn-submit:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

/* Button icons - use text instead of problematic SVG */
.btn-next::after,
.btn-submit::before {
    display: none;
}

/* ===========================================
   FOOTER INFO
   =========================================== */
.b2b-footer-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 30px 0;
    margin-top: 20px;
    border-top: 1px solid var(--b2b-border);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--b2b-text-muted);
}

.info-item svg {
    color: var(--b2b-primary);
}

/* ===========================================
   STATUS PAGE
   =========================================== */
.b2b-status {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.status-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 48px;
}

.status-icon.pending {
    background: var(--b2b-accent-soft);
}

.status-icon.approved {
    background: #d1fae5;
}

.status-icon.rejected {
    background: #fee2e2;
}

.status-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px;
    color: var(--b2b-text);
}

.status-message {
    font-size: 16px;
    color: var(--b2b-text-muted);
    margin: 0 0 30px;
    line-height: 1.6;
}

.status-details {
    background: var(--b2b-surface);
    border-radius: 12px;
    padding: 25px;
    text-align: left;
    margin-bottom: 30px;
}

.status-details h4 {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin: 0 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--b2b-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--b2b-text-muted);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--b2b-text);
}

/* ===========================================
   CUSTOMER ACCOUNT LINK
   =========================================== */
.b2b-account-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--b2b-gradient);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.b2b-account-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 112, 183, 0.3);
    color: white;
    text-decoration: none;
}

.b2b-account-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.b2b-account-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 3px;
}

.b2b-account-text span {
    font-size: 13px;
    opacity: 0.85;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .b2b-hero {
        padding: 30px 15px;
    }

    .b2b-hero h2 {
        font-size: 22px;
    }

    .b2b-benefits {
        gap: 10px;
    }

    .benefit-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    .b2b-progress {
        padding: 15px 0;
    }

    .progress-line {
        width: 30px;
    }

    .step-label {
        font-size: 11px;
    }

    .form-section {
        padding: 20px 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group-wide {
        grid-column: span 1;
    }

    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .btn-back,
    .btn-next,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }

    .b2b-footer-info {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .logged-user-card {
        flex-direction: column;
        text-align: center;
    }

    .user-badge {
        margin-top: 10px;
    }
}

/* ===========================================
   SUCCESS PAGE
   =========================================== */
.b2b-success-page {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.b2b-success-page .success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.b2b-success-page h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--b2b-text);
    margin-bottom: 10px;
}

.b2b-success-page .success-main {
    font-size: 18px;
    color: var(--b2b-text);
    margin-bottom: 40px;
}

.success-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.detail-item {
    background: var(--b2b-surface);
    padding: 25px 20px;
    border-radius: 12px;
    text-align: left;
}

.detail-icon {
    font-size: 32px;
    margin-bottom: 15px;
    display: block;
}

.detail-item strong {
    display: block;
    font-size: 16px;
    color: var(--b2b-text);
    margin-bottom: 8px;
}

.detail-item p {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin: 0;
    line-height: 1.5;
}

.success-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-home {
    background: var(--b2b-gradient);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(15, 112, 183, 0.4);
    color: white;
}

.btn-contact {
    background: white;
    border: 2px solid var(--b2b-border);
    color: var(--b2b-text);
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-contact:hover {
    border-color: var(--b2b-primary);
    color: var(--b2b-primary);
}

@media (max-width: 768px) {
    .success-details {
        grid-template-columns: 1fr;
    }

    .success-actions {
        flex-direction: column;
    }

    .btn-home,
    .btn-contact {
        width: 100%;
        text-align: center;
    }
}