@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --ttu-red: #cc0000;
    --ttu-red-hover: #b30000;
    --ttu-black: #111111;
    --ttu-charcoal: #2d2d2d;
    --ttu-light-grey: #f4f4f4;
    --ttu-border: #dddddd;
    --text-primary: #333333;
    --text-secondary: #666666;
    
    --success-bg: #e6f7ed;
    --success-border: #2ecc71;
    --success-text: #27ae60;
    
    --warning-bg: #fff9e6;
    --warning-border: #f1c40f;
    --warning-text: #d35400;
    
    --error-bg: #fdf2f2;
    --error-border: #e74c3c;
    --error-text: #c0392b;
}

html, body {
    font-family: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* App Layout */
.app-container {
    padding: 10px 20px 40px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.form-wrapper {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--ttu-border);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    transition: all 0.3s ease;
}

/* Header */
.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ttu-black);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--ttu-red);
    padding-bottom: 10px;
    text-align: left;
}

/* Fieldset and Legends */
.positions-list {
    margin-bottom: 30px;
}

.position-item {
    margin-bottom: 25px;
}

.position-fieldset {
    border: 1.5px solid var(--ttu-border);
    border-radius: 12px;
    padding: 20px;
    background-color: #fdfdfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.position-fieldset:hover {
    border-color: var(--ttu-red);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.04);
}

.position-legend {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ttu-charcoal);
    padding: 0 12px;
    width: auto;
    float: none;
    margin-bottom: 0;
}

/* Radio Option Styling */
.radio-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: var(--ttu-light-grey);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-custom {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    transition: all 0.2s ease;
}

.radio-option:hover input ~ .radio-custom {
    border-color: var(--ttu-charcoal);
}

.radio-option input:checked ~ .radio-custom {
    border-color: var(--ttu-red);
    background-color: #fff;
}

.radio-custom:after {
    content: "";
    position: absolute;
    display: none;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ttu-red);
}

.radio-option input:checked ~ .radio-custom:after {
    display: block;
}

.radio-label-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Changed/Modified State Indicator */
.text-changed {
    color: var(--ttu-red) !important;
    font-weight: 600 !important;
}

/* Messages styling */
.message-span, .messageSpan {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid;
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
}

.warning-message {
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.error-message {
    background-color: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.error-message a {
    color: var(--error-text);
    text-decoration: underline;
    font-weight: 600;
}

.information-message {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.info-submitted-message {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
}

/* Buttons */
.form-actions, .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-next, .btn-sign, .btn-cancel {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-next, .btn-sign {
    background-color: var(--ttu-red);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.2);
}

.btn-next:hover, .btn-sign:hover:not(:disabled) {
    background-color: var(--ttu-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(204, 0, 0, 0.3);
}

.btn-sign:disabled {
    background-color: #cccccc;
    color: #888888;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-cancel {
    background-color: var(--ttu-light-grey);
    color: var(--ttu-charcoal);
    border: 1px solid var(--ttu-border);
}

.btn-cancel:hover {
    background-color: #e5e5e5;
}

/* Modal Overlay & Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease forwards;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 40px;
    width: 90%;
    max-width: 1050px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--ttu-border);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 1060;
}

.modal-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ttu-black);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--ttu-red);
    padding-bottom: 10px;
}

.selected-positions {
    background-color: var(--ttu-light-grey);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.selected-positions p {
    margin: 8px 0;
}

.agreement-warning {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    color: var(--warning-text);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
    margin-bottom: 20px;
}

.agreement-list {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 25px;
}

.agreement-list li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--ttu-charcoal);
}

.modal-footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer-text a {
    color: var(--ttu-red);
    text-decoration: underline;
}

/* Loading indicator styling */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(204, 0, 0, 0.1);
    border-left-color: var(--ttu-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.l-main-pagecontent {
    min-height: initial !important;
}

@media (min-width: 31.25em) {
    .l-main-pagecontent {
        padding-top: 0px !important;
    }
}

.main-content {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

.ttu-main-content {
    padding-top: 0px !important;
    margin-top: 0px !important;
}