/* ===================================
   AGENDA ELECTRONICA - ESTILOS EMPRESARIALES
   Sistema de Gestion de Citas
   =================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #059669;
    --success-light: #d1fae5;
    --danger-color: #dc2626;
    --danger-light: #fee2e2;
    --warning-color: #d97706;
    --warning-light: #fef3c7;
    --bg-gradient-start: #1e3a8a;
    --bg-gradient-end: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
}

/* Base Styles */
body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Form Container */
#form_container {
    background: #fff;
    margin: 20px auto;
    text-align: left;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
}

/* Form Styles */
.form_description {
    border-bottom: 2px solid var(--border-color);
    clear: both;
    display: block;
    margin: 0 0 1.5em;
    padding-bottom: 1em;
}

.form_description h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.form_description p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--text-secondary);
}

/* Form Elements */
form ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

form li {
    display: block;
    margin: 0;
    padding: 12px 0;
    position: relative;
}

label.description {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* Input Styles */
input.text,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"] {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px 16px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

input.text:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.textarea,
textarea {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.select,
select {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Button Styles */
button,
input[type="submit"],
input[type="button"],
.btn {
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary,
button.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-success,
button.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.btn-danger,
button.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.bigbuttons,
.btn-lg {
    font-size: 1.1rem;
    padding: 14px 28px;
}

/* Table Styles */
table {
    border: none;
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

table th {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    text-align: center;
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    padding: 14px 16px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--bg-light);
}

/* Calendar Table */
table#CalendarTable {
    width: 100%;
    min-height: 450px;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

table#CalendarTable th {
    background: var(--primary-color);
    padding: 16px;
}

table#CalendarTable td {
    border: 1px solid var(--border-color);
    vertical-align: top;
    padding: 12px;
    min-height: 80px;
}

table#CalendarTable td#blankday {
    background-color: #f1f5f9;
}

table#CalendarTable td#daytitle {
    background-color: #fef3c7;
    text-align: center;
    font-weight: 600;
    color: var(--warning-color);
}

table#CalendarTable td a#dayNum {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

/* Error Messages */
#error_message {
    background: var(--danger-light);
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 1.5em;
    padding: 16px 20px;
    text-align: left;
}

#error_message_title {
    color: var(--danger-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

#error_message_desc {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0;
}

form li.error {
    background-color: var(--danger-light);
    border-left: 4px solid var(--danger-color);
    border-radius: 0 8px 8px 0;
    margin: 8px 0;
    padding: 16px;
}

form li.error label {
    color: var(--danger-color);
}

form p.error {
    color: var(--danger-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 6px 0 0;
}

.required {
    color: var(--danger-color);
    font-weight: 700;
}

/* Success Message */
.form_success {
    background: var(--success-light);
    border-radius: 12px;
    margin: 20px;
    padding: 60px 20px;
    text-align: center;
}

.form_success h2 {
    color: var(--success-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Checkbox and Radio */
input.checkbox,
input.radio,
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

label.choice {
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    margin-left: 8px;
}

/* Section Breaks */
form li.section_break {
    border-top: 2px solid var(--border-color);
    margin-top: 24px;
    padding-top: 24px;
}

form .section_break h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

form .section_break p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Guidelines Tooltip */
form .guidelines {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 12px 16px;
    position: absolute;
    left: 100%;
    margin-left: 12px;
    top: 0;
    visibility: hidden;
    width: 240px;
    z-index: 1000;
}

form li:hover .guidelines,
form li.highlighted .guidelines {
    visibility: visible;
}

form li.highlighted {
    background-color: #fef3c7;
    border-radius: 8px;
}

/* Footer */
#footer {
    clear: both;
    color: var(--text-secondary);
    text-align: center;
    padding: 24px;
    font-size: 0.9rem;
}

#footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Calendar Widget */
div.calendar {
    position: relative;
}

.calendar table {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.calendar thead .title {
    font-weight: 600;
    text-align: center;
    background: var(--primary-color);
    color: white;
    padding: 12px;
}

.calendar tbody td.today {
    font-weight: 700;
    color: white;
    background: var(--success-color);
    border-radius: 4px;
}

.calendar tbody td.selected {
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Cita Confirmation List */
ul#CitaConfirm li {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 0;
    color: var(--text-primary);
}

ul#CitaConfirm li a {
    color: var(--primary-color);
    text-decoration: none;
}

ul#CitaConfirm li a:hover {
    text-decoration: underline;
}

/* CAPTCHA */
#li_captcha {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

/* Password Section */
ul.password {
    margin: 40px auto;
    max-width: 400px;
    text-align: center;
}

.password h2 {
    color: var(--danger-color);
    font-weight: 600;
    margin: 0 0 16px;
}

.password input.text {
    font-size: 1.2rem;
    text-align: center;
}

.password label {
    font-size: 1rem;
    font-weight: 600;
    padding-top: 12px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #form_container {
        margin: 10px;
        border-radius: 8px;
    }

    form.appnitro {
        padding: 16px;
    }

    table th,
    table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 12px 20px;
    }

    form .guidelines {
        display: none;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Image Styles */
img {
    border: none;
    max-width: 100%;
    height: auto;
}

/* Clear Fix */
.clear,
.clearfix::after {
    clear: both;
    content: "";
    display: table;
}

/* Embedded Form */
.embed #form_container {
    border: none;
    box-shadow: none;
}

.embed #top,
.embed #bottom,
.embed h1 {
    display: none;
}

/* Size Variants */
input.small, select.small { width: 30%; }
input.medium, select.medium { width: 50%; }
input.large, select.large { width: 100%; }

textarea.small { height: 100px; }
textarea.medium { height: 180px; }
textarea.large { height: 300px; }
