:root {
    --ricoh-red: #CF122E;
    --ricoh-gray: #64666A;
    --ricoh-white: #FFFFFF;
    --ricoh-black: #000000;
    --ricoh-bg: #FAFAFA;
    --ricoh-border: #E0E0E0;
    --ricoh-text-secondary: #64666A;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Frutiger", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ricoh-black);
    background-color: var(--ricoh-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
}

h1:focus {
    outline: none;
}

a {
    color: var(--ricoh-red);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    font-family: "Frutiger", Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ricoh-black);
    background-color: var(--ricoh-white);
    border: 1px solid #C0C0C0 !important;
    border-radius: 4px;
    padding: 0.625rem 0.75rem;
    width: 100%;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--ricoh-red) !important;
}

input::placeholder,
textarea::placeholder {
    color: #9E9E9E;
}

.floating-field input[type="text"],
.floating-field input[type="password"] {
    border: 1px solid #D0D0D0 !important;
}

.floating-field input[type="text"]:focus,
.floating-field input[type="password"]:focus {
    border-color: #CF122E !important;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: #388E3C;
}

.invalid {
    outline: none;
    border-color: var(--ricoh-red);
}

.validation-message {
    color: var(--ricoh-red);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.blazor-error-boundary {
    background-color: var(--ricoh-red);
    padding: 1rem 1.5rem;
    color: white;
    font-size: 0.875rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page.";
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--ricoh-text-secondary);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.4s ease-out;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (min-width: 600px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 960px) {
    html {
        font-size: 16px;
    }
}

/* Attachment section styles */
.test-page-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.test-page-actions,
.attachment-actions {
    display: flex;
    gap: 10px;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem !important;
    font-weight: 600;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn .mud-icon-root {
    font-size: 18px !important;
    line-height: 1 !important;
}

.secondary-btn:hover {
    border-color: #CF122E;
    color: #CF122E;
}

.secondary-btn.flex-half {
    flex: 1 1 0;
}

.attachment-list {
    list-style: none;
    margin: 12px 0 0 0;
    padding: 0;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f8f8;
    border-radius: 6px;
    margin-bottom: 8px;
}

.attachment-item:last-child {
    margin-bottom: 0;
}

.attachment-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.attachment-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.attachment-remove:hover {
    background: #e0e0e0;
    color: #333;
}

.attachment-error {
    padding: 10px 12px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-size: 13px;
    margin-top: 12px;
}