/* Training Course Registration - Frontend Styles */

:root {
    --tcr-primary: #1A1A6E;
    --tcr-accent: #E8401C;
    --tcr-gradient: linear-gradient(135deg, #1A1A6E 0%, #E8401C 100%);
    --tcr-primary-light: rgba(26, 26, 110, 0.08);
    --tcr-input-bg: #f7f8fc;
    --tcr-border: #dde1ee;
    --tcr-radius: 10px;
}

/* Trigger button */
.tcr-reg-trigger-btn {
    background: var(--tcr-gradient);
    color: white;
    border: none;
    padding: 13px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 26, 110, 0.35);
    transition: all 0.25s ease;
}
.tcr-reg-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26, 26, 110, 0.42);
}

/* Overlay */
.tcr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 35, 0.78);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    animation: tcrFadeIn 0.25s ease;
}
.tcr-modal-overlay.active { display: flex !important; }
@keyframes tcrFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal container — larger */
.tcr-modal-container {
    background: white;
    border-radius: 22px;
    width: 100%;
    max-width: 1020px;
    height: 92vh;
    max-height: 720px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: tcrSlideUp 0.3s ease;
    position: relative;
}
@keyframes tcrSlideUp {
    from { transform: translateY(28px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Two-panel inner layout */
.tcr-modal-inner {
    display: flex;
    height: 100%;
}

/* ── Sidebar ── */
.tcr-modal-sidebar {
    background: var(--tcr-gradient);
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 30px 36px;
    border-radius: 22px 0 0 22px;
    position: relative;
}
.tcr-sidebar-content {
    color: white;
    flex: 1;
}
.tcr-sidebar-logo {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 22px;
    letter-spacing: 0.5px;
}
.tcr-sidebar-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
    color: white;
}
.tcr-sidebar-content > p {
    font-size: 13.5px;
    opacity: 0.88;
    margin: 0 0 22px;
    line-height: 1.55;
}

/* Course pill — always visible */
.tcr-course-pill {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: white;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
    word-break: break-word;
}
.tcr-course-pill span:first-child { flex-shrink: 0; margin-top: 1px; }

.tcr-sidebar-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.tcr-sidebar-features li {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}
.tcr-sidebar-features li span {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

/* Close button — top-right of sidebar, clearly white on gradient */
.tcr-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.22);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: white;
    font-weight: 500;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 20;
}
.tcr-close-btn:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: rotate(90deg);
}

/* ── Form panel ── */
.tcr-modal-body {
    flex: 1;
    padding: 36px 38px 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#tcrRegistrationForm {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    overflow: hidden;
}

.tcr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tcr-form-group {
    display: flex;
    flex-direction: column;
}

.tcr-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #3a3a5c;
    margin-bottom: 5px;
    letter-spacing: 0.15px;
}
.tcr-req { color: #E8401C; }

.tcr-form-group input,
.tcr-form-group select,
.tcr-form-group textarea {
    padding: 10px 13px;
    border: 1.5px solid var(--tcr-border);
    border-radius: var(--tcr-radius);
    font-size: 14px;
    background: var(--tcr-input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    color: #1a1a3e;
}
.tcr-form-group textarea {
    resize: none;
    height: 62px;
}
.tcr-form-group input:focus,
.tcr-form-group select:focus,
.tcr-form-group textarea:focus {
    outline: none;
    border-color: var(--tcr-primary);
    background: white;
    box-shadow: 0 0 0 3px var(--tcr-primary-light);
}
.tcr-form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
    background-color: var(--tcr-input-bg);
}
.tcr-form-group.error input,
.tcr-form-group.error select,
.tcr-form-group.error textarea {
    border-color: #e53935;
    background: #fff5f5;
}
.tcr-error-message {
    color: #e53935;
    font-size: 11px;
    margin-top: 3px;
    display: none;
}
.tcr-form-group.error .tcr-error-message { display: block; }

input[type="date"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.5; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Submit */
.tcr-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--tcr-gradient);
    color: white;
    border: none;
    border-radius: var(--tcr-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(26, 26, 110, 0.3);
    flex-shrink: 0;
}
.tcr-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 110, 0.38);
}
.tcr-submit-btn:active:not(:disabled) { transform: translateY(0); }
.tcr-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Loading */
.tcr-loading {
    display: none;
    flex-direction: column;
    text-align: center;
    padding: 40px 20px;
    flex: 1;
    align-items: center;
    justify-content: center;
}
.tcr-loading.active { display: flex; }
.tcr-spinner {
    border: 3px solid #eee;
    border-top: 3px solid var(--tcr-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: tcrSpin 0.85s linear infinite;
    margin-bottom: 14px;
}
@keyframes tcrSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Success */
.tcr-success-message {
    display: none;
    flex-direction: column;
    text-align: center;
    padding: 40px 20px;
    flex: 1;
    align-items: center;
    justify-content: center;
}
.tcr-success-message.active { display: flex; }
.tcr-success-icon {
    width: 76px;
    height: 76px;
    background: var(--tcr-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 34px;
    color: white;
    animation: tcrScaleIn 0.4s ease;
}
@keyframes tcrScaleIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}
.tcr-success-message h3 { font-size: 24px; margin-bottom: 10px; color: #1a1a3e; }
.tcr-success-message p  { color: #666; line-height: 1.65; margin: 0; font-size: 14px; max-width: 340px; }

/* Responsive */
@media (max-width: 720px) {
    .tcr-modal-container { height: 100vh; max-height: 100vh; border-radius: 0; }
    .tcr-modal-inner { flex-direction: column; }
    .tcr-modal-sidebar {
        width: 100%;
        border-radius: 0;
        padding: 22px 24px 18px;
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }
    .tcr-sidebar-logo { width: 40px; height: 40px; font-size: 15px; margin: 0; flex-shrink: 0; }
    .tcr-sidebar-content h2 { font-size: 16px; margin: 0 0 3px; }
    .tcr-sidebar-content > p,
    .tcr-sidebar-features,
    .tcr-course-pill { display: none; }
    .tcr-modal-body { padding: 20px; overflow-y: auto; }
    .tcr-form-row { grid-template-columns: 1fr; gap: 10px; }
    .tcr-close-btn { top: 14px; right: 14px; }
}
