/* Modern Color Palette - Red Theme */
:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --secondary-color: #fef2f2;
    --accent-color: #f97316;
    --success-color: #10b981;
    --error-color: #dc2626;
    --border-color: #e2e8f0;
    --border-color-hover: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --input-bg: #ffffff;
    --input-focus-bg: #fef2f2;
    --section-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

/* SSO Button Styling */
.rm-sso-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    margin: 10px 0;
    box-shadow: var(--shadow-md);
    width: 100% !important;
}



.rm-sso-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-secondary);
    font-weight: 500;
}

.rm-sso-divider::before,
.rm-sso-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-color);
}

.rm-sso-divider::before {
    left: 0;
}

.rm-sso-divider::after {
    right: 0;
}

.rm-sso-container {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
}

.rm-form {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
}

/* Section Styling */
.rm-form > .rm-form-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 40px;
    box-shadow: none;
    transition: none;
    position: relative;
    overflow: visible;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.rm-form h4,
.rm-form h5 {
    margin: 40px 0 40px 0;
    padding: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    display: block;
    position: relative;
    background: transparent;
}

.rm-form h4:first-child,
.rm-form h5:first-child {
    margin-top: 0;
    margin-bottom: 40px;
}

/* Label Styling */
.rm-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Prevent any pseudo-elements from adding asterisks */
.rm-form label::before,
.rm-form label::after {
    content: none !important;
    display: none !important;
}

.rm-form label .required-asterisk {
    color: var(--error-color);
    font-weight: 600;
}

/* Ensure only the span asterisk is visible */
.rm-form label .required-asterisk::before,
.rm-form label .required-asterisk::after {
    content: none !important;
    display: none !important;
}

.rm-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

/* Input Field Styling */
.rm-form input[type="text"],
.rm-form input[type="email"],
.rm-form input[type="date"],
.rm-form input[type="password"],
.rm-form input[type="file"],
.rm-form select,
.rm-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    line-height: 1.5;
}

.rm-form input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.rm-form input:hover,
.rm-form select:hover,
.rm-form textarea:hover {
    border-color: var(--border-color-hover);
}

.rm-form input:focus,
.rm-form select:focus,
.rm-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}

.rm-form input:focus::placeholder {
    color: var(--text-secondary);
}

/* Select Dropdown */
.rm-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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;
    padding-right: 40px;
}

.rm-form select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' 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");
}

/* File Input Styling */
.rm-form input[type="file"] {
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
}

.rm-form input[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.rm-form input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Helper Text */
.rm-form p {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}


/* Submit Button */
.rm-form button[type="submit"],
.rm-submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: 100%;
    margin-top: 16px;
}

.rm-form button[type="submit"]:hover,
.rm-submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rm-form button[type="submit"]:active,
.rm-submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.rm-form button[type="submit"]:disabled,
.rm-submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Navigation */
.rm-form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.rm-prev-btn,
.rm-next-btn {
    background: var(--section-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.rm-prev-btn:hover:not(:disabled),
.rm-next-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.rm-prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Progress */
.rm-form-progress {
    margin-bottom: 40px;
}

.rm-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.rm-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    width: 0;
    transition: width 0.3s ease;
}

.rm-steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.rm-step {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 8px;
}

.rm-step::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.rm-step.active {
    color: var(--primary-color);
    font-weight: 600;
}

.rm-step.active::after {
    background: var(--primary-color);
    transform: scaleX(1);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.file-preview {
    margin-top: 12px;
    min-height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

.file-preview.has-file {
    border-style: solid;
    padding: 8px;
}

.file-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.file-preview .pdf-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
}

.file-requirements {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Password Field */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-strength-meter {
    margin-top: 8px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-bar[data-strength="0"] { width: 0%; background: var(--error-color); }
.strength-bar[data-strength="1"] { width: 25%; background: var(--error-color); }
.strength-bar[data-strength="2"] { width: 50%; background: var(--accent-color); }
.strength-bar[data-strength="3"] { width: 75%; background: var(--primary-color); }
.strength-bar[data-strength="4"] { width: 100%; background: var(--success-color); }

.password-requirements {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.password-requirements li {
    margin: 4px 0;
    padding-left: 20px;
    position: relative;
}

.password-requirements li::before {
    content: "×";
    position: absolute;
    left: 0;
    color: var(--error-color);
}

.password-requirements li.valid::before {
    content: "✓";
    color: var(--success-color);
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 4px;
    min-height: 20px;
}

.rm-form-errors-top {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    color: var(--error-color);
    display: none;
}

.rm-form-errors-top.has-errors {
    display: block;
}

/* Form Steps */
.rm-form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.rm-form-step.active {
    display: block;
}

/* Form Summary */
.rm-form-summary {
    margin-top: 32px;
    padding: 24px;
    background: var(--secondary-color);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.rm-form-summary h3 {
    margin: 0 0 16px;
    color: var(--text-primary);
}

.summary-content dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0;
}

.summary-content dt {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-content dd {
    margin: 0;
    color: var(--text-primary);
}

/* Loading Overlay */
.rm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.rm-loading-message {
    margin-top: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Date Input */
.rm-form input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: opacity(0.6);
    transition: filter 0.3s ease;
}

.rm-form input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: opacity(1);
}


/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rm-form {
    animation: slideIn 0.5s ease-out;
}

.form-group {
    animation: slideIn 0.3s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }
.form-group:nth-child(5) { animation-delay: 0.25s; }
.form-group:nth-child(6) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .rm-form {
        margin: 20px auto;
        padding: 24px;
    }
    
    .rm-form > div[style*="border"] {
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    .rm-form h4,
    .rm-form h5 {
        margin: 32px 0 32px 0;
        padding: 0 0 12px 0;
        font-size: 20px;
    }
    
    .rm-form h4:first-child,
    .rm-form h5:first-child {
        margin-top: 0;
        margin-bottom: 32px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .rm-form button[type="submit"],
    .rm-submit-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .rm-form {
        padding: 20px;
    }
    
    .rm-form > div[style*="border"] {
        padding: 0 !important;
    }
    
    .rm-form h4,
    .rm-form h5 {
        margin: 24px 0 28px 0;
        padding: 0 0 12px 0;
        font-size: 18px;
    }
    
    .rm-form h4:first-child,
    .rm-form h5:first-child {
        margin-top: 0;
        margin-bottom: 28px;
    }
    
    .rm-form input[type="text"],
    .rm-form input[type="email"],
    .rm-form input[type="date"],
    .rm-form input[type="password"],
    .rm-form select {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* Privacy Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    display: block;
}
.modal-content {
    background-color: #fff;
    padding: 32px 28px 24px 28px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 700px;
    min-width: 620px;
    min-height: 0;
    border: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .modal-content {
        padding: 18px 6vw 18px 6vw;
        max-width: 98vw;
        min-width: 0;
        font-size: 0.97rem;
        min-width: 0;
        max-height: 98vh;
    }
    .close-button {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
    #proceedSSO {
        font-size: 15px;
        padding: 10px 0;
    }
}
.close-button {
    color: #e15b5b;
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}
.close-button:hover,
.close-button:focus {
    color: #b22d2d;
    text-decoration: none;
}
#proceedSSO {
    background-color: #e15b5b;
    color: #fff;
    border: none;
    padding: 12px 0;
    width: 100%;
    text-align: center;
    font-size: 16px;
    margin-top: 18px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(225,91,91,0.08);
}
#proceedSSO:disabled {
    background-color: #f3bcbc;
    cursor: not-allowed;
}
.modal-content h2 {
    color: #e15b5b;
    margin-bottom: 12px;
    font-size: 1.35rem;
    font-weight: 700;
}
.modal-content ul {
    background: #fff5f5;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 18px;
    color: #333;
    font-size: 0.98rem;
}
.modal-content ul li {
    margin-bottom: 7px;
}
.modal-content label {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 1rem;
}
.modal-content input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #e15b5b;
}
.modal-content p {
    margin-bottom: 10px;
    color: #444;
    font-size: 0.97rem;
}
.modal-content strong {
    color: #e15b5b;
}
