/* ============================================
   Startup Valuation Platform - Styles
   Reuses .rps-card, .calculate-btn, .pg-* classes
   from Presentation Generator's established patterns.
   ============================================ */

/* ---------- Guest Notice Banner ---------- */
.note-banner {
    background: #fff8e6;
    border: 1px solid #ffd680;
    color: #7a5c00;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.note-banner::before {
    content: "ℹ";
    font-size: 1.1rem;
    flex-shrink: 0;
}

.note-banner a {
    color: #2F8FB5;
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Wizard Step Navigator ---------- */
.services-container {
    max-width: 1100px;
}

.wizard-steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow-x: auto;
}

.wizard-steps::before {
    content: "";
    position: absolute;
    top: 37px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: #eee;
    z-index: 0;
}

.wizard-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #bbb;
    cursor: default;
    white-space: nowrap;
    padding: 0 10px;
    flex: 1;
    justify-content: center;
}

.wizard-step span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #eee;
    background: #fff;
    color: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.wizard-step.active {
    color: #1a1a1a;
    cursor: pointer;
}

.wizard-step.active span {
    background: #2F8FB5;
    border-color: #2F8FB5;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(47,143,181,0.15);
}

.wizard-step.completed {
    color: #1a1a1a;
    cursor: pointer;
}

.wizard-step.completed span {
    background: #00997A;
    border-color: #00997A;
    color: #fff;
}

.wizard-step.completed span::after {
    content: "✓";
}

/* ---------- Wizard Panels ---------- */
.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeInPanel 0.25s ease;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-panel .rps-card,
.rps-card {
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 1px solid #f2f2f2;
    padding: 32px;
}

.rps-card-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.rps-card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

/* ---------- Form field polish ---------- */
.pg-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pg-input,
.pg-select,
.pg-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    background: #fafbfc;
    font-size: 0.92rem;
    color: #1a1a1a;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pg-input:focus,
.pg-select:focus,
.pg-textarea:focus {
    border-color: #2F8FB5;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47,143,181,0.08);
    outline: none;
}

.pg-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px 24px;
}

.pg-field {
    display: flex;
    flex-direction: column;
}

h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
    border-left: 3px solid #2F8FB5;
    padding-left: 10px;
    margin: 28px 0 16px;
}

/* ---------- Dynamic Rows (competitors, rounds, owners, use of funds) ---------- */
.dynamic-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    background: #fafbfc;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 12px;
}

.dynamic-row .pg-input {
    background: #fff;
}

.row-remove-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #dc3545;
    border: 1.5px solid #fdecea;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.row-remove-btn:hover {
    background: #f8d7da;
}

/* ---------- Logo Upload ---------- */
.logo-preview-box {
    width: 180px;
    height: 180px;
    border: 2px dashed #d5d5d5;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fafbfc, #f5f6f7);
    overflow: hidden;
    transition: border-color 0.2s;
}

.logo-preview-box:hover {
    border-color: #2F8FB5;
}

.logo-preview-box span {
    color: #999;
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pg-color-input {
    width: 70px;
    height: 46px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: none;
}

/* ---------- Sliders ---------- */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #eee;
    accent-color: #2F8FB5;
    margin-top: 6px;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2F8FB5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(47,143,181,0.4);
    border: 2px solid #fff;
}

.range-val {
    display: inline-block;
    margin-top: 6px;
    background: #eef6fa;
    color: #2F8FB5;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ---------- Financial Input Table ---------- */
.financial-input-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
}

.financial-input-table th {
    background: linear-gradient(135deg, #2F8FB5, #257599);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
}

.financial-input-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.financial-input-table td:first-child {
    font-weight: 600;
    color: #444;
    background: #fafbfc;
    white-space: nowrap;
}

.financial-input-table tr:hover td {
    background: #f5f9fb;
}

.financial-input-table input {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 7px 10px;
    text-align: right;
    font-size: 0.88rem;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- Buttons ---------- */
.calculate-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    transition: transform 0.15s, box-shadow 0.15s !important;
}

.calculate-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.wizard-next,
#calculateBtn,
#generatePdfBtn {
    box-shadow: 0 4px 16px rgba(47,143,181,0.25);
}

/* ---------- Results Metric Boxes ---------- */
.metric-row-html {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.metric-box {
    border: 1.5px solid #f0f0f0;
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    background: #fff;
    transition: transform 0.2s;
}

.metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.metric-box.highlight {
    border-color: #2F8FB5;
    background: linear-gradient(135deg, #f0f7fa, #e8f4f9);
}

.metric-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin-top: 4px;
}

.metric-box.highlight .metric-value {
    color: #2F8FB5;
}

/* ---------- Report Table (used inline for previews) ---------- */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.88rem;
}

.report-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f5f5f5;
    color: #555;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

.report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

/* ============================================
   Auth Pages - Enterprise Polish
   ============================================ */

.auth-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    border: 1px solid #f0f0f0;
}

.auth-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2F8FB5, #00997A);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(47,143,181,0.25);
}

.auth-card h1.auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.auth-card p.auth-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin: 0 0 28px;
}

.auth-form-field {
    margin-bottom: 18px;
}

.auth-form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.auth-form-field input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.auth-form-field input:focus {
    outline: none;
    border-color: #2F8FB5;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47,143,181,0.1);
}

.auth-form-field small {
    display: block;
    color: #aaa;
    font-size: 0.75rem;
    margin-top: 5px;
}

.auth-forgot-link {
    text-align: right;
    margin-bottom: 20px;
}

.auth-forgot-link a {
    font-size: 0.85rem;
    color: #2F8FB5;
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot-link a:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2F8FB5, #257599);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(47,143,181,0.3);
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(47,143,181,0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-switch-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.88rem;
    color: #777;
}

.auth-switch-text a {
    color: #2F8FB5;
    font-weight: 700;
    text-decoration: none;
}

.auth-switch-text a:hover {
    text-decoration: underline;
}

.auth-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.87rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-success {
    background: #e8f8f0;
    border: 1px solid #b8e6ce;
    color: #1e7e50;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.87rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-error::before { content: "⚠"; font-size: 1rem; }
.auth-success::before { content: "✓"; font-size: 1rem; }

/* ============================================
   RESPONSIVE FIXES
   (kept last so these rules win the cascade)
   ============================================ */

/* ---------- Tablet: wizard steps become scrollable, more compact ---------- */
@media (max-width: 900px) {
    .wizard-steps {
        justify-content: flex-start;
        padding: 18px 14px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .wizard-steps::-webkit-scrollbar {
        height: 4px;
    }
    .wizard-steps::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 4px;
    }

    .wizard-steps::before {
        left: 40px;
        right: 40px;
    }

    .wizard-step {
        flex: 0 0 auto;
        min-width: 80px;
        font-size: 0.68rem;
        padding: 0 6px;
    }

    .wizard-step span {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
}

/* ---------- Mobile: compact step circles, labels hide except active ---------- */
@media (max-width: 560px) {
    .wizard-steps {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 4px;
    }

    .wizard-steps::before {
        display: none;
    }

    .wizard-step {
        min-width: 68px;
        font-size: 0.62rem;
        gap: 5px;
    }

    .wizard-step span {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    /* Hide text label on non-active steps to save space; keep it on active */
    .wizard-step:not(.active) .wizard-step-label {
        display: none;
    }
}

@media (max-width: 400px) {
    .wizard-steps {
        padding: 14px 10px;
    }

    .wizard-step {
        min-width: 56px;
    }
}

/* ---------- General form/layout responsiveness ---------- */
@media (max-width: 768px) {
    .pg-settings-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .rps-card {
        padding: 18px !important;
    }

    .rps-card-header h3 {
        font-size: 1.1rem;
    }

    .dynamic-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .dynamic-row .row-remove-btn {
        align-self: flex-end;
    }

    .financial-input-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .financial-input-table th,
    .financial-input-table td {
        min-width: 100px;
    }

    .metric-row-html {
        grid-template-columns: 1fr !important;
    }

    /* Back/Continue button pairs stack full-width on mobile */
    .wizard-panel div[style*="display:flex"][style*="gap:10px"] {
        flex-direction: column;
    }

    .wizard-back,
    .wizard-next,
    #calculateBtn,
    #generatePdfBtn {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .services-container {
        padding: 0 12px;
    }

    .auth-card {
        padding: 28px 22px;
    }
}

/* ---------- Financial Table: contained horizontal scroll on mobile ---------- */
@media (max-width: 768px) {
    #financialTable {
        display: block;
    }

    #financialTable thead,
    #financialTable tbody {
        display: block;
    }

    .financial-input-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        border: 1px solid #eee;
        margin: 0 -18px;
        padding: 0 18px;
    }

    .financial-input-table {
        display: table !important;
        min-width: 560px;
        border: none;
    }

    .financial-input-table thead,
    .financial-input-table tbody {
        display: table-header-group;
    }

    .financial-input-table tbody {
        display: table-row-group;
    }

    .financial-input-table tr {
        display: table-row;
    }

    .financial-input-table th,
    .financial-input-table td {
        display: table-cell;
    }
}