/**
 * GP Business Signup Request Modal — Styles
 * Version: 1.0.0
 * Matches GRIPAR login form design language with business-appropriate enhancements.
 */

/* ═══════════════════════ MODAL OVERLAY ═══════════════════════ */

.gpbs-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gpbs-modal-overlay.show {
    opacity: 1;
}

/* ═══════════════════════ MODAL CONTAINER ═══════════════════════ */

.gpbs-modal-container {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gpbs-modal-overlay.show .gpbs-modal-container {
    transform: translateY(0) scale(1);
}

.gpbs-modal-container::-webkit-scrollbar { width: 6px; }
.gpbs-modal-container::-webkit-scrollbar-track { background: transparent; }
.gpbs-modal-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

/* ═══════════════════════ MODAL CARD ═══════════════════════ */

.gpbs-modal-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid #E5E7EB;
    position: relative;
}

/* ═══════════════════════ CLOSE BUTTON ═══════════════════════ */

.gpbs-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: none;
    background: #F3F4F6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.15s ease;
    z-index: 10;
}

.gpbs-modal-close:hover {
    background: #E5E7EB;
    color: #374151;
}

/* ═══════════════════════ HEADER ═══════════════════════ */

.gpbs-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.gpbs-modal-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #FFFFFF;
}

.gpbs-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.gpbs-modal-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ═══════════════════════ STEP INDICATOR ═══════════════════════ */

.gpbs-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 16px;
}

.gpbs-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.gpbs-step-active, .gpbs-step-done {
    opacity: 1;
}

.gpbs-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #6B7280;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gpbs-step-active .gpbs-step-num {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #FFFFFF;
}

.gpbs-step-done .gpbs-step-num {
    background: #10B981;
    color: #FFFFFF;
}

.gpbs-step-label {
    font-size: 10px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gpbs-step-active .gpbs-step-label {
    color: #1e3a5f;
}

.gpbs-step-done .gpbs-step-label {
    color: #10B981;
}

.gpbs-step-line {
    flex: 0 0 40px;
    height: 2px;
    background: #E5E7EB;
    margin: 0 8px;
    margin-bottom: 18px;
    border-radius: 1px;
    transition: background 0.2s ease;
}

.gpbs-step-line-done {
    background: #10B981;
}

/* ═══════════════════════ FORM STYLES ═══════════════════════ */

.gpbs-form {
    display: block;
}

.gpbs-form-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gpbs-form-group {
    margin-bottom: 14px;
}

.gpbs-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.gpbs-required {
    color: #DC2626;
    font-weight: 700;
}

.gpbs-hint {
    font-weight: 400;
    color: #9CA3AF;
    font-size: 11px;
}

.gpbs-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #FAFBFC;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

.gpbs-form-input:focus {
    border-color: #2d5a8e;
    box-shadow: 0 0 0 3px rgba(45, 90, 142, 0.12);
    background: #FFFFFF;
}

.gpbs-form-input::placeholder {
    color: #9CA3AF;
}

.gpbs-form-input.gpbs-input-error {
    border-color: #DC2626;
    animation: gpbs-shake 0.3s ease;
}

@keyframes gpbs-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Select wrapper */
.gpbs-select-wrapper {
    position: relative;
}

.gpbs-form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
}

.gpbs-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9CA3AF;
}

/* Form row */
.gpbs-form-row {
    display: flex;
    gap: 12px;
}

.gpbs-form-half {
    flex: 1;
}

/* ═══════════════════════ FILE UPLOAD ═══════════════════════ */

.gpbs-upload-area {
    position: relative;
    border: 2px dashed #D1D5DB;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #FAFBFC;
}

.gpbs-upload-area:hover {
    border-color: #2d5a8e;
    background: #F0F4FA;
}

.gpbs-upload-area.gpbs-upload-dragover {
    border-color: #2d5a8e;
    background: #E8EFF8;
    box-shadow: 0 0 0 3px rgba(45, 90, 142, 0.15);
}

.gpbs-upload-area.gpbs-upload-error {
    border-color: #DC2626;
    animation: gpbs-shake 0.3s ease;
}

.gpbs-file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.gpbs-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #6B7280;
}

.gpbs-upload-placeholder svg {
    color: #9CA3AF;
}

.gpbs-upload-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.gpbs-upload-hint {
    font-size: 12px;
    color: #9CA3AF;
}

.gpbs-upload-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    position: relative;
    z-index: 3;
}

.gpbs-file-icon {
    font-size: 24px;
}

.gpbs-file-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

.gpbs-file-size {
    font-size: 12px;
    color: #6B7280;
    white-space: nowrap;
}

.gpbs-file-remove {
    width: 24px; height: 24px;
    border: none;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.gpbs-file-remove:hover {
    background: #FECACA;
}

/* ═══════════════════════ BUTTONS ═══════════════════════ */

.gpbs-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gpbs-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.gpbs-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gpbs-btn-full {
    width: 100%;
}

.gpbs-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gpbs-btn-secondary:hover {
    background: #E5E7EB;
}

.gpbs-btn-row {
    margin-top: 20px;
    justify-content: space-between;
}

/* ═══════════════════════ LOADING SPINNER ═══════════════════════ */

.gpbs-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gpbs-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: gpbs-spin 0.6s linear infinite;
}

.gpbs-loading .gpbs-spinner {
    display: inline-block;
}

.gpbs-loading .gpbs-btn-text {
    opacity: 0.7;
}

@keyframes gpbs-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════ ERROR MESSAGE ═══════════════════════ */

.gpbs-error-message {
    display: none;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #991B1B;
    line-height: 1.4;
}

.gpbs-error-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.gpbs-error-text {
    flex: 1;
}

/* ═══════════════════════ SUCCESS STATE ═══════════════════════ */

.gpbs-success {
    text-align: center;
    padding: 20px 0;
}

.gpbs-success-icon svg {
    width: 60px; height: 60px;
}

.gpbs-success-icon circle {
    fill: none;
    stroke: #10B981;
    stroke-width: 2;
}

.gpbs-success-icon path {
    stroke: #10B981;
    stroke-width: 3;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: gpbs-check-draw 0.6s ease-out 0.3s forwards;
}

@keyframes gpbs-check-draw {
    to { stroke-dashoffset: 0; }
}

.gpbs-success h4 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 14px 0 8px;
}

.gpbs-success p {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.5;
}

/* ═══════════════════════ OTP STEP ═══════════════════════ */

.gpbs-otp-step {
    padding: 10px 0;
}

.gpbs-otp-header {
    text-align: center;
    margin-bottom: 20px;
}

.gpbs-otp-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.gpbs-otp-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.gpbs-otp-header p {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

.gpbs-otp-input {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
}

.gpbs-otp-status {
    text-align: center;
    font-size: 13px;
    margin-top: 10px;
    display: none;
}

.gpbs-otp-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #6B7280;
}

.gpbs-otp-timer {
    color: #9CA3AF;
    display: none;
}

.gpbs-otp-resend,
.gpbs-otp-back {
    color: #2d5a8e;
    text-decoration: none;
    font-weight: 600;
}

.gpbs-otp-resend:hover,
.gpbs-otp-back:hover {
    text-decoration: underline;
}

.gpbs-otp-separator {
    margin: 0 8px;
    color: #D1D5DB;
}

/* ═══════════════════════ DEV OTP ═══════════════════════ */

.gpbs-dev-otp {
    margin-bottom: 14px;
}

.gpbs-dev-code-container {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 8px 14px;
    text-align: center;
    font-size: 13px;
}

.gpbs-dev-label {
    color: #92400E;
}

.gpbs-dev-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #92400E;
    letter-spacing: 3px;
}

/* ═══════════════════════ SECTION ICONS ═══════════════════════ */

.gpbs-icon-mail::before { content: '📧'; margin-right: 2px; }
.gpbs-icon-briefcase::before { content: '🏢'; margin-right: 2px; }
.gpbs-icon-doc::before { content: '📋'; margin-right: 2px; }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */

@media (max-width: 480px) {
    .gpbs-modal-card {
        padding: 24px 20px 20px;
        border-radius: 14px;
    }

    .gpbs-modal-container {
        max-width: 100%;
        max-height: 95vh;
    }

    .gpbs-form-row {
        flex-direction: column;
        gap: 0;
    }

    .gpbs-step-label {
        display: none;
    }

    .gpbs-step-line {
        margin-bottom: 0;
    }

    .gpbs-btn-row {
        flex-direction: column;
        gap: 8px;
    }

    .gpbs-btn-row .gpbs-btn-secondary {
        order: 2;
    }

    .gpbs-btn-row .gpbs-btn-primary {
        order: 1;
        width: 100%;
    }
}

/* ═══════════════════════ LOGIN FOOTER LINKS ═══════════════════════ */

.gp-footer-links-signup {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E5E7EB;
}

.gp-footer-links-signup .gp-footer-link {
    font-weight: 600;
}

.gpbs-signup-trigger {
    color: #1e3a5f !important;
}

.gpbs-status-trigger {
    color: #0369a1 !important;
}