/**
 * Car Show Registration Form Styles
 *
 * Mobile-first responsive design
 *
 * @package Car_Show_Registration
 * @since 1.0.0
 */

/* ===================================
   Base Styles & Container
   =================================== */

.csr-registration-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ===================================
   Form Header
   =================================== */

.csr-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.csr-form-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #0073aa;
}

.csr-event-date {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.csr-registration-fee {
    font-size: 20px;
    margin: 15px 0 0;
}

.csr-registration-fee strong {
    color: #0073aa;
    font-size: 24px;
}

/* ===================================
   Messages (Success/Error)
   =================================== */

.csr-success-message,
.csr-error-message {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 5px;
}

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

.csr-success-message h2 {
    color: #155724;
    margin-top: 0;
}

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

.csr-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.csr-notice-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.csr-notice-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.csr-thank-you {
    font-size: 18px;
    font-weight: 500;
    margin-top: 20px;
}

/* ===================================
   Duplicate Email Warning
   =================================== */

.csr-duplicate-warning {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
}

.csr-duplicate-warning h2 {
    color: #d63638;
    margin-top: 0;
}

.csr-existing-registration {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.csr-existing-registration h3 {
    margin-top: 0;
    color: #0073aa;
}

.csr-registration-details {
    margin-top: 20px;
}

.csr-detail-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.csr-detail-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 16px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.csr-detail-section p {
    margin: 8px 0;
}

.csr-car-detail {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.csr-car-detail ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.csr-car-detail li {
    margin: 3px 0;
}

.csr-duplicate-actions {
    margin-top: 30px;
    padding: 25px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.csr-duplicate-actions h3 {
    margin-top: 0;
    color: #856404;
}

.csr-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.csr-delete-form {
    margin: 0;
}

.csr-button-danger {
    background-color: #d63638;
    color: #fff;
}

.csr-button-danger:hover {
    background-color: #b32d2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(214, 54, 56, 0.3);
}

.csr-security-note {
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    margin: 15px 0;
    font-size: 14px;
    color: #333;
}

.csr-confirmation-field {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 5px;
}

.csr-confirmation-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.csr-confirmation-field .required {
    color: #d63638;
}

.csr-confirmation-field input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    text-transform: uppercase;
}

.csr-confirmation-field input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.csr-field-help {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.csr-warning-note {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-left: 4px solid #d63638;
    font-size: 14px;
    color: #721c24;
}

.csr-help-note {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f1;
    border-left: 4px solid #0073aa;
    font-size: 14px;
    color: #333;
}

.csr-help-note a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.csr-help-note a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .csr-duplicate-warning {
        padding: 20px 15px;
    }

    .csr-existing-registration,
    .csr-duplicate-actions {
        padding: 15px;
    }

    .csr-detail-section {
        padding: 10px;
    }

    .csr-confirmation-field {
        padding: 15px;
    }

    .csr-confirmation-field input[type="text"] {
        max-width: 100%;
    }
}

/* ===================================
   Form Sections
   =================================== */

.csr-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.csr-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #0073aa;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

/* ===================================
   Form Fields
   =================================== */

.csr-form-field {
    margin-bottom: 20px;
}

.csr-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.csr-form-field .required {
    color: #d63638;
}

.csr-form-field .optional {
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.csr-input,
.csr-form input[type="text"],
.csr-form input[type="email"],
.csr-form input[type="tel"],
.csr-form input[type="number"],
.csr-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.csr-input:focus,
.csr-form input:focus,
.csr-form select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.csr-input.error,
.csr-form input.error,
.csr-form select.error {
    border-color: #d63638;
}

.csr-field-description {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.csr-field-error {
    color: #d63638;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.csr-field-error.visible {
    display: block;
}

/* ===================================
   Form Rows (Two-column layout)
   =================================== */

.csr-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.csr-form-row .csr-form-field {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .csr-form-row {
        flex-direction: column;
        gap: 0;
    }

    .csr-form-row .csr-form-field {
        margin-bottom: 20px;
    }
}

/* ===================================
   Car Entries
   =================================== */

.csr-car-entry {
    padding: 20px;
    margin-bottom: 25px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.csr-car-entry h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 18px;
}

.csr-custom-make-field,
.csr-custom-club-field {
    margin-top: 15px;
    padding: 15px;
    background: #fffbf0;
    border: 1px solid #f0e68c;
    border-radius: 4px;
}

.csr-checkbox-field label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.csr-checkbox-field input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

/* ===================================
   Collapsable Car Sections
   =================================== */

.csr-car-collapsable {
    margin-bottom: 15px;
}

.csr-car-toggle {
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #0073aa;
    user-select: none;
}

.csr-car-toggle:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.csr-car-toggle.active {
    background: #f0f8ff;
    border-color: #0073aa;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.csr-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.csr-car-toggle.active .csr-toggle-icon {
    transform: rotate(45deg);
}

.csr-toggle-text {
    flex: 1;
}

.csr-car-content {
    border: 2px solid #0073aa;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.csr-car-content .csr-car-entry {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

/* ===================================
   Payment Section
   =================================== */

.csr-payment-section {
    background: #f0f8ff;
    border-color: #0073aa;
}

.csr-total-amount {
    font-size: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    text-align: center;
}

.csr-total-amount strong {
    color: #0073aa;
    font-size: 28px;
}

.csr-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.csr-payment-option {
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

.csr-payment-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.csr-payment-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.3);
}

.csr-payment-option input[type="radio"]:checked ~ span {
    color: #0073aa;
}

/* ===================================
   Buttons
   =================================== */

.csr-button {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 150px;
}

.csr-button-primary {
    background-color: #0073aa;
    color: #fff;
}

.csr-button-primary:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.csr-button-secondary {
    background-color: #666;
    color: #fff;
}

.csr-button-secondary:hover {
    background-color: #444;
}

.csr-button-venmo {
    background-color: #3d95ce;
    color: #fff;
}

.csr-button-venmo:hover {
    background-color: #2d7fb8;
}

.csr-button-submit {
    width: 100%;
    padding: 16px 28px;
    font-size: 18px;
    margin-top: 10px;
}

/* ===================================
   Form Actions
   =================================== */

.csr-form-actions {
    margin-top: 30px;
}

.csr-required-note {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* ===================================
   PayPal Redirect
   =================================== */

.csr-paypal-redirect {
    text-align: center;
    padding: 40px 20px;
}

.csr-paypal-redirect p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* ===================================
   Venmo Payment
   =================================== */

.csr-venmo-payment {
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.csr-venmo-payment h2 {
    margin-top: 0;
    color: #3d95ce;
}

.csr-venmo-payment h3 {
    margin-top: 30px;
    color: #0073aa;
}

.csr-venmo-options {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

.csr-venmo-mobile,
.csr-venmo-desktop {
    flex: 1;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

@media (max-width: 768px) {
    .csr-venmo-options {
        flex-direction: column;
    }

    .csr-venmo-desktop {
        display: none;
    }
}

@media (min-width: 769px) {
    .csr-venmo-mobile {
        display: none;
    }
}

.csr-qr-code {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 20px auto;
    display: block;
}

.csr-qr-placeholder {
    width: 300px;
    height: 300px;
    margin: 20px auto;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.csr-copy-link {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    font-size: 14px;
    font-family: monospace;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.csr-venmo-manual-link {
    margin-top: 20px;
}

/* ===================================
   Venmo Transaction Form
   =================================== */

.csr-venmo-transaction-form {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border: 2px solid #3d95ce;
    border-radius: 8px;
}

.csr-venmo-transaction-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.csr-venmo-transaction-form input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ===================================
   Check Payment Instructions
   =================================== */

.csr-check-instructions {
    padding: 25px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    margin: 20px 0;
}

.csr-check-instructions h3 {
    margin-top: 0;
    color: #0073aa;
}

.csr-check-details {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.csr-reference-note {
    font-weight: 600;
    color: #d63638;
    margin-top: 15px;
}

/* ===================================
   Loading State
   =================================== */

.csr-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.csr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: csr-spin 1s linear infinite;
}

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

/* ===================================
   Print Styles
   =================================== */

@media print {
    .csr-registration-wrapper {
        max-width: 100%;
        padding: 20px;
    }

    .csr-form,
    .csr-button,
    .csr-form-actions,
    .csr-payment-methods {
        display: none;
    }

    .csr-success-message,
    .csr-check-instructions {
        page-break-inside: avoid;
        border: 2px solid #000;
    }

    .csr-venmo-mobile,
    .csr-venmo-transaction-form {
        display: none;
    }

    .csr-qr-code {
        max-width: 200px;
    }
}

/* ===================================
   Accessibility
   =================================== */

.csr-input:focus-visible,
.csr-button:focus-visible,
.csr-payment-option:focus-within {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Screen reader only text */
.csr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 768px) {
    .csr-registration-wrapper {
        padding: 15px;
    }

    .csr-form-header h2 {
        font-size: 24px;
    }

    .csr-section {
        padding: 20px 15px;
    }

    .csr-button {
        padding: 12px 20px;
        font-size: 15px;
    }

    .csr-button-submit {
        padding: 14px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .csr-form-header h2 {
        font-size: 20px;
    }

    .csr-event-date {
        font-size: 16px;
    }

    .csr-registration-fee {
        font-size: 18px;
    }

    .csr-section h3 {
        font-size: 18px;
    }

    .csr-car-entry {
        padding: 15px;
    }
}

/* ===================================
   High Contrast Mode Support
   =================================== */

@media (prefers-contrast: high) {
    .csr-input,
    .csr-form input,
    .csr-form select {
        border-width: 2px;
    }

    .csr-button {
        border: 2px solid currentColor;
    }
}

/* ===================================
   Mock reCAPTCHA (Test Mode)
   =================================== */

.csr-mock-recaptcha-box {
    border: 2px solid #1c3aa9;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csr-mock-recaptcha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 304px;
    height: 78px;
    padding: 0 12px;
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    font-family: Roboto, helvetica, arial, sans-serif;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.09);
    position: relative;
}

.csr-mock-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.csr-mock-checkbox-label {
    width: 28px;
    height: 28px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.csr-mock-checkbox-label:hover {
    border-color: #4d90fe;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.csr-mock-checkbox:checked + .csr-mock-checkbox-label {
    border-color: #0d652d;
    background: #fff;
}

.csr-checkmark {
    display: none;
    width: 20px;
    height: 20px;
}

.csr-mock-checkbox:checked + .csr-mock-checkbox-label .csr-checkmark {
    display: block;
    animation: checkmark-pop 0.2s ease-out;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.csr-mock-recaptcha-content {
    flex: 1;
    margin-left: 12px;
    margin-right: 12px;
}

.csr-mock-recaptcha-text {
    font-size: 14px;
    color: #000;
    font-weight: 500;
    line-height: 1.5;
}

.csr-mock-recaptcha-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.csr-mock-recaptcha-logo svg,
.csr-mock-recaptcha-logo img {
    width: 72px;
    height: 72px;
}

/* ===================================
   reCAPTCHA Inline Error Message
   =================================== */

.csr-recaptcha-error {
    display: inline-block;
    margin-left: 20px;
    vertical-align: top;
}

.csr-recaptcha-error p {
    background-color: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #d63638;
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 300px;
}

/* Responsive: Stack error below reCAPTCHA on mobile */
@media (max-width: 768px) {
    .csr-recaptcha-error {
        display: block;
        margin-left: 0;
        margin-top: 12px;
    }

    .csr-recaptcha-error p {
        max-width: 100%;
    }
}

/* ===================================
   Spinner Animation
   =================================== */

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

/* ===================================
   Venmo Responsive Links
   =================================== */

/* Desktop: show web link, hide mobile deep link */
.csr-venmo-mobile-link {
    display: none !important;
}

.csr-venmo-desktop-link {
    display: inline-block !important;
}

@media (max-width: 768px) {
    /* Mobile: show deep link, hide web link */
    .csr-venmo-mobile-link {
        display: inline-block !important;
    }

    .csr-venmo-desktop-link {
        display: none !important;
    }
}

