/* Checkatrade API Form Styles - Mobile First */

/* Font Faces */
@font-face {
    font-family: 'Haffer';
    src: url('../fonts/Haffer-Regular.woff2') format('woff2');
    font-weight: 430;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Haffer';
    src: url('../fonts/Haffer-Medium.woff2') format('woff2');
    font-weight: 570;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Degular Display';
    src: url('../fonts/DegularDisplay-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Degular Display';
    src: url('../fonts/DegularDisplay-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
.checkatrade-api-wrapper {
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.checkatrade-api-form {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
}

/* Screen Management */
.checkatrade-api-screen {
    display: none;
    background: #f7f7f6;
    padding: 0;
    min-height: 100vh;
}

.checkatrade-api-screen.active {
    display: block;
}

/* Header & Logo */
.checkatrade-api-header {
    margin: 0;
    border-bottom: 1px solid #EDEDED;
    border-radius: 24px 24px 0 0;
    padding: 0 16px 8px;
    background: #fff;
    box-sizing: border-box;
}

.header-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px;
    border-radius: 24px 24px 0 0;
}

/* Content Wrapper */
.checkatrade-api-content {
    padding: 24px;
    border-width: 0 1px 1px 1px;
    border-style: solid;
    border-color: #EDEDED;
    margin: 0;
}

.success-content {
    padding: 24px 20px 20px 20px;
}

.partnership-text {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    line-height: 20px;
    color: #514C5B;
    margin: 0;
}

.checkatrade-api-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkatrade-api-logo img {
    width: 217px;
    height: 30px;
}

/* Screen Titles */
.screen-title {
    font-family: "Degular Display", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #101D41;
    margin: 0 0 4px 0;
    line-height: 38px;
    text-align: left;
}

.screen-description {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 430;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 24px;
    text-align: left;
}

/* Form Fields */
.checkatrade-api-field {
    margin-bottom: 24px;
}

.checkatrade-api-field label {
    display: block;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 570;
    color: #333;
    margin-bottom: 8px;
    line-height: 24px;
}

.field-hint {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    font-weight: 430;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 20px;
}

.checkatrade-api-field input[type="text"],
.checkatrade-api-field input[type="email"],
.checkatrade-api-field input[type="tel"],
.checkatrade-api-field textarea,
.checkatrade-api-field select {
    width: 100%;
    padding: 16px;
    border: 1px solid #CACFFF;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 430;
    font-family: inherit;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.checkatrade-api-field input:focus,
.checkatrade-api-field textarea:focus,
.checkatrade-api-field select:focus {
    outline: none;
    border-color: #0066cc;
}

.checkatrade-api-field input::placeholder,
.checkatrade-api-field textarea::placeholder {
    color: #666;
    font-weight: 430;
}

.checkatrade-api-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Input with icon wrapper */
.input-with-icon {
    position: relative;
}

.input-with-icon .field-icon,
.textarea-with-icon .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    z-index: 10;
    pointer-events: none;
}

.input-with-icon select,
.input-with-icon input {
    padding-left: 48px !important;
}

.textarea-with-icon {
    position: relative;
}

.textarea-with-icon .field-icon-left {
    top: 20px;
    transform: none;
}

.textarea-with-icon .field-icon-right {
    right: 16px;
    left: auto;
    top: 14px;
    transform: none;
}

.textarea-with-icon textarea {
    padding-left: 48px !important;
}

.button-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Select2 Customization */
.checkatrade-api-field .select2-container {
    width: 100% !important;
}

.input-with-icon .select2-container--default .select2-selection--single {
    height: auto;
    padding: 14px 16px 14px 48px !important;
    border: 1px solid #CACFFF;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.input-with-icon .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0 !important;
}

.checkatrade-api-field .select2-container--default .select2-selection--single {
    height: auto;
    padding: 14px 16px;
    border: 1px solid #CACFFF;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.checkatrade-api-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.5;
    color: #333;
    font-size: 16px;
}

.checkatrade-api-field .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #666;
}

.checkatrade-api-field .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 16px;
    width: 24px;
}

.checkatrade-api-field .select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none;
}

.checkatrade-api-field .select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-image: url('../img/drop-down.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.checkatrade-api-field .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0066cc;
}

.checkatrade-api-field .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0066cc;
    border-radius: 999px;
}

.input-with-icon .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0066cc;
    border-radius: 999px;
}

.select2-dropdown {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(25, 35, 56, 0.15);
    overflow: hidden;
    margin-top: 4px;
}

.select2-dropdown--below {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.select2-dropdown--above {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.select2-search--dropdown {
    padding: 12px 16px 8px 16px;
    background: #fff;
}

.select2-search--dropdown .select2-search__field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #CACFFF;
    border-radius: 999px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.select2-search--dropdown .select2-search__field::placeholder {
    color: #666;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #0066cc;
}

.select2-results {
    background: #fff;
}

.select2-results__options {
    max-height: 300px;
    overflow-y: auto;
}

.select2-results__option {
    padding: 12px 16px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.select2-results__option--highlighted {
    background-color: #f5f5f5;
    color: #333;
}

.select2-results__option--selected {
    background-color: #e8ecff;
    color: #101D41;
}

/* Description Container (Top) */
.description-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid #CACFFF;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.description-container .field-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.description-container .dropdown-arrow-icon {
    display: none;
}

.description-container textarea {
    flex: 1;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    padding: 0;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    line-height: 1.5;
    color: #333;
    resize: none;
    min-height: 89px;
    background: transparent;
}

.description-container textarea::placeholder {
    color: #666;
}

/* Photo Upload Wrapper */
.photo-upload-wrapper {
    position: relative;
}

/* Photo Upload Container (Bottom) */
.photo-upload-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0;
    background: #fff;
    border-width: 0 1px 1px 1px;
    border-style: solid;
    border-color: #CACFFF;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 2px 4px -2px rgba(25, 35, 56, 0.06), 0 4px 8px -2px rgba(25, 35, 56, 0.08);
}

.photo-upload-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.photo-upload-section .field-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.photo-upload-button {
    flex: 1;
    border: none;
    background: transparent;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    color: #666;
    text-align: left;
    cursor: default;
    padding: 0;
    pointer-events: none;
}

.photo-dropdown-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 16px 12px;
    cursor: pointer;
    opacity: 0.3;
    pointer-events: none;
    transition: all 0.3s ease;
    min-width: 0;
}

.photo-dropdown-section.active {
    opacity: 1;
    pointer-events: auto;
}

.photo-dropdown-section.active:hover {
    opacity: 0.8;
}

.photo-count-text {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 430;
    color: #666;
    white-space: nowrap;
}

.dropdown-toggle-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    display: none;
}

.photo-dropdown-section.active .dropdown-toggle-icon {
    display: block;
}

.dropdown-toggle-icon.rotated {
    transform: rotate(180deg);
}

.photo-preview-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid #CACFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(25, 35, 56, 0.15);
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.photo-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    margin-bottom: 0;
    position: relative;
}

.photo-card:last-child {
    border-bottom: none;
}

.photo-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #fff;
}

.photo-details {
    flex: 1;
    min-width: 0;
}

.photo-filename {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 1px;
}

.photo-filesize {
    font-size: 11px;
    color: #666;
}

.photo-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: bold;
}

.photo-card-remove:hover {
    background: #ff4757;
    color: #fff;
}

/* Checkbox Field */
.checkbox-field {
    margin-top: 24px;
}

.checkbox-label {
    position: relative;
    padding-left: 20px;
    cursor: pointer;
    font-weight: 430;
    display: flex;
    align-items: flex-start;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 4px;
    width: 13px;
    height: 13px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid #040154;
    border-radius: 1px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #040154;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9'%3E%3Cpath fill='%23fff' d='M7.47 1.847L3.37 5.95 1.516 4.095A.563.563 0 00.72 4.891l2.25 2.25a.563.563 0 00.796 0l4.5-4.5a.563.563 0 00-.796-.794z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px;
}

.checkbox-text {
    font-size: 14px;
    font-weight: 430;
    color: #333;
    line-height: 20px;
    display: block;
}

.checkbox-text a {
    color: #0066cc;
    text-decoration: none;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Buttons */
.checkatrade-api-submit {
    margin-top: 24px;
}

.checkatrade-api-button {
    width: 100%;
    padding: 16px;
    background: #fff;
    border: 1px solid #101D41;
    border-radius: 100px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 20px;
    font-weight: 570; /* Figma: 790 - Using 570 (Medium) until Haffer ExtraBold is available */
    color: #101D41;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
}

.checkatrade-api-button:hover {
    background: #101D41;
    color: #fff;
}

.checkatrade-api-button:disabled {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Field Error States */
.checkatrade-api-field.has-error .input-with-icon select,
.checkatrade-api-field.has-error .input-with-icon input,
.checkatrade-api-field.has-error textarea,
.checkatrade-api-field.has-error .description-container,
.checkatrade-api-field.has-error .photo-upload-container {
    border-color: #ed5d03;
}

.checkatrade-api-field.has-error .description-container {
    border-bottom: none;
}

.checkatrade-api-field.has-error .photo-upload-container {
    border-color: #ed5d03;
}

/* Select2 error state */
.checkatrade-api-field.has-error .select2-container--default .select2-selection--single {
    border-color: #ed5d03;
}

.input-with-icon.has-error .select2-container--default .select2-selection--single {
    border-color: #ed5d03;
}

/* Checkbox error state */
.checkatrade-api-field.checkbox-field.has-error .checkbox-label input[type="checkbox"] {
    border-color: #ed5d03;
}

/* Field error message */
.field-error {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 430;
    line-height: 18px;
    color: #a03000;
    margin: 8px 0 0 0;
    display: none;
}

.checkatrade-api-field.has-error .field-error {
    display: block;
}

/* Messages */
.checkatrade-api-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.checkatrade-api-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.checkatrade-api-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success Page (Screen 3) */
.success-content {
    text-align: left;
}

.success-title {
    font-family: "Degular Display", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #101D41;
    margin: 0 0 4px 0;
    line-height: 38px;
}

.success-subtitle {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    font-weight: 430;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
    text-align: left;
}

.success-icon {
    margin-bottom: 24px;
    text-align: center;
}

.success-icon img {
    width: 96px;
    height: 99px;
}

.success-info-section {
    text-align: left;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.info-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.info-icon img {
    width: 24px;
    height: 24px;
}

.info-content h3 {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18px;
    font-weight: 570;
    color: #101D41;
    margin: 0 0 4px 0;
    line-height: 28px;
}

.info-content p {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    font-weight: 430;
    color: #333;
    margin: 0;
    line-height: 1.5;
    max-width: 320px;
}

/* App Promotion */
.app-promotion {
    background: #FF3F3F;
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.app-promotion h3 {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18.835px;
    font-weight: 570; /* Figma: 670 - Using 570 (Medium) until Haffer Semibold is available */
    margin: 0 0 4px 0;
    line-height: 1.333;
}

.app-promotion p {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14.649px;
    font-weight: 430;
    margin: 0 0 16px 0;
    opacity: 0.95;
    line-height: 1.714;
}

.app-badges {
    display: flex;
    gap: 8px;
    justify-content: left;
    flex-wrap: wrap;
}

.app-badge {
    height: 50px;
    width: auto;
}

/* Tablet Styles */
@media (min-width: 768px) {
    .checkatrade-api-wrapper {
        padding: 20px;
    }

    .checkatrade-api-screen {
        border-radius: 12px;
        min-height: auto;
    }

    .checkatrade-api-content {
        padding: 24px;
    }

    .success-content {
        padding: 40px 40px 40px 40px;
    }

    .screen-title {
        font-size: 28px;
    }

    .screen-description {
        font-size: 16px;
    }

    .photo-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 16px;
    }

    .success-title {
        font-size: 32px;
    }

    .success-icon {
        font-size: 80px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .checkatrade-api-wrapper {
        max-width: 800px !important;
        width: 800px !important;
    }

    .checkatrade-api-content {
        padding: 24px;
    }

    /* Desktop description textarea height */
    .description-container textarea {
        height: 60px;
        min-height: 60px;
    }

    /* Desktop photo cards - more compact */
    .photo-card {
        padding: 6px 0;
        gap: 6px;
    }

    .photo-thumbnail {
        width: 32px;
        height: 32px;
    }

    .photo-filename {
        font-size: 12px;
    }

    .photo-filesize {
        font-size: 10px;
    }

    .photo-card-remove {
        width: 20px;
        height: 20px;
        font-size: 16px;
        top: 6px;
        right: 6px;
    }

    /* Two-column layout for time and location fields on Screen 1 */
    .screen-1 .checkatrade-api-content > .checkatrade-api-field:nth-child(5),
    .screen-1 .checkatrade-api-content > .checkatrade-api-field:nth-child(6) {
        display: inline-block;
        width: calc(50% - 12px);
        vertical-align: top;
        margin-bottom: 24px;
    }

    .screen-1 .checkatrade-api-content > .checkatrade-api-field:nth-child(5) {
        margin-right: 16px;
    }

    /* Two-column layout for personal details on Screen 2 */
    /* First row: First name and Last name */
    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(3),
    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(4) {
        display: inline-block;
        width: calc(50% - 12px);
        vertical-align: top;
        margin-bottom: 24px;
    }

    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(3) {
        margin-right: 16px;
    }

    /* Second row: Email and Mobile number */
    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(5),
    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(6) {
        display: inline-block;
        width: calc(50% - 12px);
        vertical-align: top;
        margin-bottom: 24px;
    }

    .screen-2 .checkatrade-api-content > .checkatrade-api-field:nth-child(5) {
        margin-right: 16px;
    }

    .success-content {
        padding: 24px;
        padding-bottom: 16px;
    }

    .screen-title {
        font-size: 30px;
    }

    .info-content p {
        max-width: 720px;
    }

    .app-promotion {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 16px 17px;
        border-radius: 8px;
        text-align: left;
    }

    .app-promo-text {
        width: 444px;
        flex-shrink: 0;
    }

    .app-promo-text h3 {
        font-size: 18.835px;
        font-weight: 570; /* Figma: 670 - Using 570 (Medium) until Haffer Semibold is available */
        line-height: 25.113px;
        margin: 0 0 8px 0;
        white-space: nowrap;
    }

    .app-promo-text p {
        font-size: 14px;
        font-weight: 430;
        line-height: 20px;
        margin: 0;
        max-width: 400px;
    }

    .app-badges {
        flex-shrink: 0;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .app-badge {
        height: 39px;
    }

    .app-badges a:first-child .app-badge {
        width: 130px;
    }

    .app-badges a:last-child .app-badge {
        width: 115px;
    }

    .checkatrade-api-button {
        width: 100%;
    }

    .checkatrade-api-submit {
        text-align: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Address Autocomplete Styles */
.address-autocomplete-wrapper {
    position: relative;
}

.address-loading-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

.address-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #CACFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(25, 35, 56, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.address-autocomplete-item {
    padding: 12px 16px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.address-autocomplete-item:hover,
.address-autocomplete-item.active {
    background-color: #f5f5f5;
}

.address-autocomplete-no-results {
    padding: 16px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    color: #666;
    text-align: center;
}

/* Category Autocomplete Styles */
.category-autocomplete-wrapper {
    position: relative;
}

.category-loading-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.category-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #CACFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(25, 35, 56, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.category-autocomplete-item {
    padding: 12px 16px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.category-autocomplete-item:hover,
.category-autocomplete-item.active {
    background-color: #f5f5f5;
}

.category-autocomplete-no-results,
.category-autocomplete-hint {
    padding: 16px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    color: #666;
    text-align: center;
}

/* Category autocomplete input padding for spinner */
.category-autocomplete-wrapper .input-with-icon input {
    padding-right: 48px;
}

/* Category autocomplete error state */
.checkatrade-api-field.has-error .category-autocomplete-wrapper .input-with-icon input {
    border-color: #ed5d03;
}

.selected-address-display {
    margin-top: 8px;
    margin-left: 10px;
    padding: 0;
    background: transparent;
    border: none;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 430;
    color: #666;
    line-height: 1.5;
}

/* Adjust input padding when loading spinner is visible */
.address-autocomplete-wrapper .input-with-icon input {
    padding-right: 48px;
}

/* Screen 2.5: Trade Selection Styles */
.trade-selection-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-option-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-option-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trade-option-title {
    font-family: "Degular Display", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 38px;
    color: #040154;
    margin: 0 0 4px 0;
}

.trade-option-description {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    line-height: 24px;
    color: #666666;
    margin: 0;
}

.btn-auto-match {
    width: 100%;
    padding: 16px;
    background: #fff;
    border: 1px solid #040154;
    border-radius: 100px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 790;
    line-height: 20px;
    color: #040154;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auto-match:hover {
    background: #040154;
    color: #fff;
}

/* Divider */
.trade-option-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #CCCCCB;
}

.divider-text {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 430;
    line-height: 30px;
    color: #666666;
    text-align: center;
}

/* Selection Counter */
.trade-selection-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #EDEDED;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.counter-label {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    line-height: 20px;
    color: #666666;
    transition: color 0.3s ease;
}

.counter-value {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 790;
    line-height: 20px;
    color: #040154;
    transition: color 0.3s ease;
}

/* Counter error state (no trades selected on submit) */
.trade-selection-counter.error {
    background: #FFF3E6;
    border-color: #A03000;
}

.trade-selection-counter.error .counter-label,
.trade-selection-counter.error .counter-value {
    color: #D64000;
}

/* Counter when full (3/3) */
.trade-selection-counter.full {
    background: #E8F4FD;
    border-color: #0066CC;
}

.trade-selection-counter.full .counter-label,
.trade-selection-counter.full .counter-value {
    color: #0066CC;
}

/* Trade Cards List */
.trade-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
}

.trade-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px 16px 11px 12px;
    background: #FFFFFF;
    border: 1px solid #CACFFF;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.trade-card-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trade-card:hover {
    border-color: #040154;
    box-shadow: 0 2px 8px rgba(4, 1, 84, 0.1);
}

/* Disabled card state */
.trade-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.trade-card.disabled:hover {
    border-color: #CACFFF;
    box-shadow: none;
}

.trade-card-checkbox {
    display: flex;
    align-items: center;
    padding: 1px 0 0;
}

.trade-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #667985;
    border-radius: 2px;
    background: #FFFFFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.trade-checkbox:checked {
    background-color: #040154;
    border-color: #040154;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}

.trade-card-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.trade-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #F0F0F0;
    border: 1px solid #F7F7F6;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trade-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.trade-name {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    line-height: 16px;
    color: #0D0D0D;
    margin: 0 0 4px 0;
}

.trade-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-value {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 430;
    line-height: 18px;
    color: #0D0D0D;
}

.rating-count {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 430;
    line-height: 18px;
    color: #333333;
}

.trade-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-card-arrow img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

/* Expanded card state */
.trade-card.expanded {
    border-color: #CACFFF;
}

.trade-card.expanded .arrow-icon {
    transform: rotate(180deg);
}

/* Trade Card Divider */
.trade-card-divider {
    width: 100%;
    height: 1px;
    background: #E5E5E5;
    margin: 8px 0;
}

/* Trade Card Expanded Content */
.trade-card-expanded {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px 4px;
}

.trade-expanded-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* AI Summary Section */
.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.ai-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ai-title {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    line-height: 20px;
    color: #302D35;
}

.ai-summary-text {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 430;
    line-height: 20px;
    color: #333333;
    margin: 0;
}

/* Recent Work Section */
.section-title {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    line-height: 20px;
    color: #302D35;
    margin: 0 0 4px 0;
}

.work-gallery {
    display: flex;
    gap: 8px;
}

.work-photo {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    background: #F0F0F0;
    flex-shrink: 0;
    cursor: pointer;
}

/* Lightbox */
.work-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

body.lightbox-open {
    overflow: hidden;
}

.work-lightbox-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    width: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.lightbox-title {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 570;
    margin: 0;
    color: #0d0d0d;
}

.lightbox-close {
    background: none;
    border: 1px solid #cacfff;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #101D41;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: #f5f5f5;
}

.lightbox-body {
    padding: 0 24px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.lightbox-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-footer {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lightbox-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lightbox-prev,
.lightbox-next {
    width: 40px;
    height: 40px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #101D41;
}

.lightbox-prev:hover:not(:disabled),
.lightbox-next:hover:not(:disabled) {
    background: #f5f5f5;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lightbox-counter {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #333;
}

.lightbox-close-btn {
    background: #fff;
    border: 2px solid #101D41;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    color: #101D41;
    cursor: pointer;
    align-self: flex-start;
}

.lightbox-close-btn:hover {
    background: #f5f5f5;
}

/* Show More Trades */
.show-more-hint {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 430;
    line-height: 18px;
    color: #101D41;
    margin: 0 0 8px 0;
    text-align: center;
}

.show-more-trades-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 570;
    line-height: 24px;
    color: #101D41;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.show-more-trades-btn:hover {
    opacity: 0.7;
}

.btn-submit-selection {
    width: 100%;
    padding: 16px;
    background: #fff;
    border: 1px solid #040154;
    border-radius: 100px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 790;
    line-height: 20px;
    color: #040154;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit-selection:hover {
    background: #040154;
    color: #fff;
}

.btn-submit-selection:disabled {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Trade Loading/Error/Empty States */
.trades-loading,
.trades-error,
.trades-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.trades-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #040154;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.trades-loading-text,
.trades-error-text,
.trades-empty-text {
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 430;
    line-height: 24px;
    color: #666666;
    margin: 0;
}

.trades-retry-btn {
    margin-top: 16px;
    padding: 12px 24px;
    background: #040154;
    border: none;
    border-radius: 100px;
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 570;
    line-height: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.trades-retry-btn:hover {
    background: #030142;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(4, 1, 84, 0.2);
}

/* Trade Avatar Initials */
.trade-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: "Haffer", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 570;
    color: #fff;
    text-transform: uppercase;
}

/* Print Styles */
@media print {
    .checkatrade-api-wrapper {
        max-width: 100%;
    }

    .checkatrade-api-screen {
        min-height: auto;
    }

    .checkatrade-api-button {
        display: none;
    }
    
    .address-autocomplete-dropdown,
    .category-autocomplete-dropdown {
        display: none !important;
    }
}
