:root {
    --primary-color: #0087FE;
    --primary-dark: #006FE3;
    --text-color: #333;
    --text-light: #666;
    --background-color: #ffffff;
    --border-color: #e1e5e9;
    --error-color: #dc3545;
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 40px;
    padding: 20px 0;
    position: relative;
    display: none;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
    width: 10%;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 50px;
}

/* Steps */
.step {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.step.active {
    display: flex;
}

.step-content {
    width: 100%;
    max-width: 600px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overline {
    font-family: 'Instrument Serif', serif;
    font-size: 2.2rem;
    font-weight: 500;
    color: black;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

h1 {
    font-family: 'Instrument Serif', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 30px;
}

.description {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Trustpilot Image */
.trustpilot-image {
    width: 100%;
    max-width: 120px;
    height: auto;
    margin: 15px auto;
    display: block;
}

/* Hero Image */
.hero-image {
    width: 100%;
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

/* Benefits List */
.benefits-list {
    margin-bottom: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 18px;
    color: var(--text-light);
}

.benefit-item .check-icon {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

/* Timing Info */
.timing-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    font-size: 18px;
    color: var(--text-light);
    font-style: italic;
}

.clock-icon {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 
        inset 1px 1px 0px rgba(255, 255, 255, 0.2),
        inset 0px 20px 0px rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: 400px;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Pulse Animation for Welcome Button */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.footnote {
    margin-top: 20px;
    font-size: 18px;
    color: var(--text-light);
    font-style: italic;
}

/* Credit Rating Footnote */
.credit-footnote {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.check-icon {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

/* Custom checkbox styles */
.checkbox-group {
    margin-top: 10px;
    width: 100%;
}

.checkbox-label-text {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-700);
    user-select: none;
    width: 100%;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-color);
}

/* Terms Footnote */
.terms-footnote {
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.option-card {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background-color: white;
    text-align: center;
    font-weight: 500;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-card:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 135, 254, 0.05);
}

.option-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(0, 135, 254, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.option-card span {
    font-size: 1rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.input-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: white;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 135, 254, 0.1);
}

.input-group input.error {
    border-color: var(--error-color);
}

.input-group select {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 135, 254, 0.1);
}

.input-group select.error {
    border-color: var(--error-color);
}

/* Currency Input */
.currency-input {
    position: relative;
}

.currency-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
}

/* Fix alignment for overdraft fields that have labels */
.overdraft-details .currency-symbol {
    top: auto;
    bottom: 16px;
    transform: none;
}

.currency-input input {
    padding-left: 40px;
}

/* Overdraft Details */
.overdraft-details {
    margin-top: 30px;
    animation: fadeIn 0.3s ease;
}

/* Shareholder step specific credit footnote with extra bottom margin */
.shareholder-credit-footnote {
    margin-bottom: 160px !important;
}

/* Shareholder Form Styles */
.shareholder-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.shareholder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shareholder-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.remove-shareholder-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-shareholder-btn:hover {
    background: #c82333;
}

.shareholder-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.name-row {
    display: flex;
    gap: 16px;
}

.half-width {
    flex: 1;
}

.ownership-group {
    max-width: 200px;
}

.percentage-input {
    position: relative;
}

.percentage-symbol {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
}

.percentage-input input {
    padding-right: 40px;
}

.dob-group label,
.address-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.dob-inputs {
    display: flex;
    gap: 12px;
}

.dob-inputs input {
    flex: 1;
    height: 56px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
    min-width: 0;
}

.dob-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dob-inputs input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Ensure all text inputs fill their container width */
.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="email"],
.input-group input[type="tel"] {
    width: 100%;
}

/* Shareholder form specific styling */
.shareholder-form .name-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.shareholder-form .name-row .input-group {
    flex: 1;
    max-width: none;
    margin: 0;
}

.shareholder-form .name-row .input-group input {
    width: 100%;
}

.shareholder-form .dob-group label,
.shareholder-form .address-group label {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.shareholder-form .address-group .input-group {
    max-width: none;
    margin: 0 0 12px 0;
}

.shareholder-form .address-group .input-group input {
    width: 100%;
}

/* Center align the Continue button */
#continueShareholderBtn {
    display: block;
    margin: 20px auto;
    text-align: center;
}

.address-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-add-shareholder {
    background: #FAFAFA !important;
    color: #262626 !important;
    margin: 20px 0 !important;
}

.btn-add-shareholder:hover {
    background: #FAFAFA !important;
}

@media (max-width: 768px) {
    .name-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .dob-inputs {
        gap: 8px;
    }
    
    .dob-inputs input {
        max-width: none;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Slider Styles */
.slider-container {
    padding: 40px 20px;
    text-align: center;
}

.slider-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.loan-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    appearance: none;
    margin: 20px 0;
    cursor: pointer;
    transition: var(--transition);
}

.loan-slider::-webkit-slider-thumb {
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 135, 254, 0.3);
    transition: var(--transition);
}

.loan-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 135, 254, 0.4);
}

.loan-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 135, 254, 0.3);
    transition: var(--transition);
}

.loan-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 135, 254, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
}

@media (max-width: 768px) {
    .slider-value {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .slider-container {
        padding: 30px 10px;
    }
}

/* Contact Form */
.contact-form {
    max-width: 400px;
    margin: 0 auto;
}

/* Error Message */
.error-message {
    display: none;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 16px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    font-weight: 500;
}

.error-message.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* Loading State */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .description {
        font-size: 18px;
    }

    .hero-image {
        max-width: 100%;
        width: 100%;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .option-card {
        padding: 16px;
        min-height: 60px;
    }

    .btn-primary {
        padding: 14px 28px;
        font-size: 1rem;
        width: 100%;
        max-width: 400px;
    }

    .progress-container {
        margin-bottom: 0px;
        padding: 15px 0;
        gap: 10px;
    }
    
    .progress-text {
        font-size: 14px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .description {
        font-size: 18px;
        margin-bottom: 30px;
    }

    .hero-image {
        max-width: 100%;
        width: 100%;
    }

    .option-card {
        padding: 14px;
        min-height: 50px;
    }

    .option-card span {
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 350px;
    }

    .input-group {
        max-width: 350px;
    }

    .input-group input {
        padding: 14px;
        font-size: 16px;
        width: 100%;
    }
    
    /* Fix currency input spacing on mobile */
    .currency-input input {
        padding-left: 35px;
    }
}

/* Back button styling */
.btn-back {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-back:hover {
    cursor: pointer;
}

.btn-back:focus {
    outline: none;
}

/* Companies House Autocomplete Styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item .company-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    font-size: 14px;
}

.autocomplete-item .company-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.autocomplete-item .company-number {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.autocomplete-item .company-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.autocomplete-item .company-status.status-dissolved {
    background-color: #fef2f2;
    color: #dc2626;
}

.autocomplete-item .company-status.status-liquidation {
    background-color: #fef3c7;
    color: #d97706;
}

.autocomplete-item .company-address {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}

.loading-search {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    color: var(--text-light);
    font-size: 14px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive autocomplete */
@media (max-width: 768px) {
    .autocomplete-results {
        max-height: 250px;
    }
    
    .autocomplete-item {
        padding: 10px 12px;
    }
    
    .autocomplete-item .company-name {
        font-size: 13px;
    }
    
    .autocomplete-item .company-number,
    .autocomplete-item .company-address {
        font-size: 11px;
    }
}
