/**
 * Registration Hardcopy Styles
 * Standalone registration forms (non-popup)
 */

.em-reg-hardcopy-section {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.em-reg-hardcopy-form {
    width: 100%;
}

/* Form Groups */
.em-form-group {
    margin-bottom: 1.5rem;
}

/* Compact Table Layout (like popup) */
.em-form-table {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
}

.em-form-table-row {
    display: table-row;
}

.em-form-table-row label {
    display: table-cell;
    padding: 8px 12px 8px 0;
    vertical-align: middle;
    width: 140px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.em-form-table-row label .required {
    color: #d9534f;
}

.em-form-table-row input {
    display: table-cell;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.em-form-table-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 640px) {
    .em-form-table,
    .em-form-table-row,
    .em-form-table-row label,
    .em-form-table-row input {
        display: block;
        width: 100%;
    }
    
    .em-form-table-row label {
        padding: 0 0 8px 0;
        margin-bottom: 0;
    }
    
    .em-form-table-row {
        margin-bottom: 1rem;
    }
}

.em-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .em-form-row {
        grid-template-columns: 1fr;
    }
}

.em-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.em-form-group label .required {
    color: #d9534f;
}

.em-form-group input[type="text"],
.em-form-group input[type="email"],
.em-form-group input[type="password"],
.em-form-group input[type="tel"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.em-form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Only show validation errors after user has touched the field */
.em-form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #d9534f;
}

.em-form-group input.error {
    border-color: #d9534f;
}

/* Radio Groups */
.em-radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.em-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.em-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Checkbox Groups */
.em-checkbox-group {
    margin-top: 1rem;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.em-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: normal !important;
}

.em-checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Custom checkbox styling (from popup) */
.em-checkbox-label.bzc-checkbox-wrapper {
    align-items: flex-start;
    gap: 0;
}

.em-checkbox-label.bzc-checkbox-wrapper .bzc-checkbox-custom {
    position: relative;
    display: inline-block;
    height: 24px;
    width: 24px;
    min-width: 24px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin-right: 10px;
    margin-top: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.em-checkbox-label.bzc-checkbox-wrapper .em-disclaimer-text {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.em-checkbox-label.bzc-checkbox-wrapper:hover .bzc-checkbox-custom {
    border-color: #667eea;
}

.em-checkbox-label.bzc-checkbox-wrapper input[type="checkbox"]:checked ~ .bzc-checkbox-custom {
    background-color: #10b981;
    border-color: #10b981;
}

.em-checkbox-label.bzc-checkbox-wrapper .bzc-checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.em-checkbox-label.bzc-checkbox-wrapper input[type="checkbox"]:checked ~ .bzc-checkbox-custom:after {
    display: block;
}

.em-checkbox-label.bzc-checkbox-wrapper input[type="checkbox"]:focus ~ .bzc-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Hide native checkbox when using custom styles */
.em-checkbox-label.bzc-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.em-disclaimer-text {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.em-disclaimer-text a {
    color: #4CAF50;
    text-decoration: underline;
    cursor: pointer;
}

.em-disclaimer-text a:hover {
    color: #45a049;
    text-decoration: none;
}

.em-disclaimer-expanded {
    display: block;
    white-space: pre-line;
    margin-top: 10px;
}

/* Timeline Slider (same as popup) */
.em-timeline-slider-group {
    margin-bottom: 2rem;
}

.em-timeline-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.em-timeline-browsing {
    flex-shrink: 0;
}

.em-timeline-browsing input[type="radio"] {
    display: none;
}

.em-timeline-browsing label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
}

.em-timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    transition: all 0.3s;
}

.em-timeline-browsing input:checked + label .em-timeline-dot {
    background: #007bff;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0,123,255,0.2);
}

.em-timeline-label {
    font-size: 12px;
    text-align: center;
    margin-top: 0.5rem;
    color: #666;
    line-height: 1.2;
}

.em-timeline-slider {
    flex: 1;
    position: relative;
    padding: 0 1rem;
}

.em-timeline-slider input[type="radio"] {
    display: none;
}

.em-timeline-track {
    position: absolute;
    top: 10px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.em-timeline-progress {
    position: absolute;
    top: 10px;
    left: 1rem;
    height: 2px;
    background: #007bff;
    z-index: 2;
    transition: width 0.3s;
}

.em-timeline-slider > label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 3;
}

/* Desktop: All labels above the line */
.em-timeline-slider > label {
    top: 0;
}

.em-timeline-slider > label .em-timeline-label {
    margin-bottom: 8px;
}

.em-timeline-slider > label .em-timeline-dot {
    margin: 0;
}

.em-timeline-slider > label[data-position="0"] { left: 0; transform: translateX(-50%); }
.em-timeline-slider > label[data-position="1"] { left: 20%; transform: translateX(-50%); }
.em-timeline-slider > label[data-position="2"] { left: 40%; transform: translateX(-50%); }
.em-timeline-slider > label[data-position="3"] { left: 60%; transform: translateX(-50%); }
.em-timeline-slider > label[data-position="4"] { left: 80%; transform: translateX(-50%); }
.em-timeline-slider > label[data-position="5"] { left: 100%; transform: translateX(-50%); }

/* Update progress bar based on selection */
.em-timeline-slider:has(input[id*="ttb-1"]:checked) .em-timeline-progress { width: 0%; }
.em-timeline-slider:has(input[id*="ttb-2"]:checked) .em-timeline-progress { width: 19%; }
.em-timeline-slider:has(input[id*="ttb-3"]:checked) .em-timeline-progress { width: 38%; }
.em-timeline-slider:has(input[id*="ttb-4"]:checked) .em-timeline-progress { width: 57%; }
.em-timeline-slider:has(input[id*="ttb-5"]:checked) .em-timeline-progress { width: 76%; }
.em-timeline-slider:has(input[id*="ttb-6"]:checked) .em-timeline-progress { width: 90%; }

/* Mobile: Alternating above/below positioning */
@media (max-width: 768px) {
    .em-timeline-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .em-timeline-slider {
        min-height: 120px;
        padding: 40px 0 30px;
    }
    
    /* Above timeline - text above, dot at 40px */
    .em-timeline-slider > label.em-timeline-above {
        top: 0;
    }
    
    .em-timeline-slider > label.em-timeline-above .em-timeline-label {
        margin-bottom: 8px;
    }
    
    .em-timeline-slider > label.em-timeline-above .em-timeline-dot {
        margin: 0;
    }
    
    /* Below timeline - dot at 40px, text below */
    .em-timeline-slider > label.em-timeline-below {
        top: 40px;
    }
    
    .em-timeline-slider > label.em-timeline-below .em-timeline-label {
        margin-top: 8px;
        order: 2;
    }
    
    .em-timeline-slider > label.em-timeline-below .em-timeline-dot {
        margin: 0;
        order: 1;
    }
    
    .em-timeline-track {
        top: 40px;
    }
    
    .em-timeline-progress {
        top: 40px;
    }
    
    .em-timeline-subtitle {
        top: 80px;
    }
}

.em-timeline-slider input:checked + label .em-timeline-dot {
    background: #007bff;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0,123,255,0.2);
    transform: scale(1.2);
}

.em-timeline-subtitle {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 12px;
    color: #999;
}

/* Conditional Fields */
.em-conditional-field {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Buttons */
.em-btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: inline-block;
}

.em-btn-primary {
    background: #007bff;
    color: #fff;
}

.em-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.em-btn-primary:active {
    transform: translateY(0);
}

.em-btn-primary:disabled,
.em-btn-primary.em-btn-disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

/* Error state for fields */
input.error,
select.error {
    border-color: #d9534f !important;
    background-color: #fff5f5;
}

input[type="radio"].error,
input[type="checkbox"].error {
    outline: 2px solid #d9534f;
    outline-offset: 2px;
}

.em-reg-continue-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Login Form */
.em-login-hardcopy {
    max-width: 500px;
}

.em-forgot-password-link {
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.em-forgot-password-link a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.em-forgot-password-link a:hover {
    text-decoration: underline;
}

.em-login-submit-btn {
    width: 100%;
}

.em-login-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
}

.em-login-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.em-login-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Loading State */
.em-form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.em-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shake animation for validation errors */
@keyframes emShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.em-form-group.em-field-incomplete {
    animation: emShake 0.5s;
}

.em-form-group.em-field-incomplete input,
.em-form-group.em-field-incomplete select,
.em-form-group.em-field-incomplete textarea {
    border-color: #e74c3c !important;
    border-width: 2px !important;
}

.em-form-group.em-field-incomplete > label {
    color: #e74c3c !important;
}

.em-form-group.em-field-incomplete .em-radio-group {
    animation: emShake 0.5s;
}

.em-checkbox-group.em-field-incomplete {
    animation: emShake 0.5s;
    border-left: 3px solid #e74c3c;
    padding-left: 10px;
    margin-left: -13px;
}

/* Form table row incomplete styling */
.em-form-table-row.em-field-incomplete {
    animation: emShake 0.5s;
}

.em-form-table-row.em-field-incomplete input,
.em-form-table-row.em-field-incomplete select,
.em-form-table-row.em-field-incomplete textarea {
    border-color: #e74c3c !important;
    border-width: 2px !important;
}

.em-form-table-row.em-field-incomplete > label {
    color: #e74c3c !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .em-reg-hardcopy-section {
        padding: 1.5rem;
        margin: 0 1rem 2rem;
    }
    
    .em-timeline-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .em-timeline-slider {
        padding: 0;
    }
}
