@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --danger-color: #BA1200;
    --danger-hover: #900e00;
    --success-color: #28a745;
    --success-hover: #218838;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dddddd;
}

* {
    box-sizing: border-box;
}

body {
    width: 100%;
    margin: 0 auto;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.body-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 5%;
}

header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

h1, h2, h3, h4, h5 {
    color: #222;
    margin-top: 0;
}

h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* User Info Bar */
.user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 0.95rem;
    color: #555;
}

.pipe {
    margin-right: 8px;
    margin-left: 8px;
    color: #999;
}

/* Cards & Layout */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    
    /* Enable Flexbox column layout */
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards stretch to equal height in the grid */
}

/* Push button to bottom left */
.card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* Align buttons in centered cards */
.card.text-center {
    align-items: center;
}

.card.text-center .btn {
    align-self: center;
}

.card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
    cursor: pointer;
}

.processcontainer {
    width: 100%;
}

/* Grid Systems */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.grid-container label {
    display: block;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
}

.grid-container label:hover {
    background-color: #f0f7ff;
    border-color: var(--primary-color);
}

.grid-container input {
    margin-right: 8px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, opacity 0.2s;
    text-align: center;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    color: #fff;
    text-decoration: none;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}
.btn-success:hover {
    background-color: var(--success-hover);
    color: #fff;
    text-decoration: none;
}

/* Legacy Buttonmain Styles */
.buttonmain {
    color: #fff;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    padding: 0.6rem 1.25rem;
    margin-bottom: 10px;
    font-size: 1.15rem;
    line-height: 1.5;
    border-radius: 0.3rem;
    transition: background-color 0.2s, opacity 0.2s;
    text-decoration: none;
}

.buttonmain:hover:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    text-decoration: none;
}

.buttonmain:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buttonmain.logout {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}
.buttonmain.logout:hover:not(:disabled) {
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
}

.buttonmain.authorize {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.buttonmain.loading.blue {
    background-color: #99b3cf !important;
    cursor: not-allowed !important;
}

.buttonmain.loading.logout {
    background-color: #b8665e !important;
    cursor: not-allowed !important;
}

.button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.buttonmain.previous {
    transform: translateX(-15px);
}

.buttonmain.next {
    transform: translateX(15px);
}

.button-row .buttonmain.previous:only-child,
.button-row .buttonmain.next:only-child {
    transform: translateX(0);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.textinput {
    border: 2px solid var(--primary-color);
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: text;
    padding: 0.5rem 1rem;
    font-size: 1.15rem;
    line-height: 1.5;
    border-radius: 0.3rem;
    margin-bottom: 10px;
    width: 100%;
    max-width: 450px;
}

.textinput:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,.25);
}

/* Alerts & Notices */
.reminder {
    margin-top: 15px;
    margin-bottom: 15px;
    color: #B50000;
    font-weight: 500;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

#error-message-container {
    color: #BA1200;
    padding-bottom: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.success-card {
    border-left: 5px solid var(--success-color);
    background-color: #f9fff9;
}

.error-card {
    border-left: 5px solid var(--danger-color);
    background-color: #fff9f9;
}

/* Spinners & Loading States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #666;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    width: 100%;
    margin: 40px auto 20px auto;
}

.infofooter {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.infofooter p {
    margin: 0;
    line-height: 1.8;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

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

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

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.w-100 { width: 100%; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Admin Styles */
.admin-badge {
    display: inline-block;
    background-color: var(--danger-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}


