* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #147CA6;
    --success-green: #39BF68;
    --warning-orange: #F2884B;
    --warning-yellow: #ffc107;
    --danger-red: #F25D50;
    --dark: #0D0D0D;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-light: #e9ecef;
    --text-muted: #6c757d;
    --shadow: 0 4px 20px rgba(20, 124, 166, 0.1);
    --shadow-hover: 0 8px 30px rgba(20, 124, 166, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1e8bc3 100%);
    min-height: 100vh;
    color: var(--dark);
}

.header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue), var(--success-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-back {
    background: linear-gradient(135deg, var(--text-muted), #868e96);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
    color: var(--white);
    text-decoration: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.main-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-blue), #1e8bc3);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.card-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
}

input, select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(20, 124, 166, 0.1);
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), #1e8bc3);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(20, 124, 166, 0.3);
}

.btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.hidden {
    display: none;
}

/* Alertas */
.alert {
    margin-top: 2rem;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideDown 0.5s ease;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-green), #2ea85f);
    color: white;
    box-shadow: 0 4px 15px rgba(57, 191, 104, 0.3);
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger-red), #e84545);
    color: white;
    box-shadow: 0 4px 15px rgba(242, 93, 80, 0.3);
}

.alert-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.alert-content {
    flex: 1;
    line-height: 1.5;
}

.alert-text {
    font-size: 16px;
    font-weight: 500;
}

.alert-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.alert-link:hover {
    opacity: 0.8;
}

.alert-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Resultados */
.result-card {
    margin-top: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: slideDown 0.4s ease;
}

.result-error {
    border-left: 5px solid var(--danger-red);
    background: linear-gradient(135deg, #fff8f8, #fff0f0);
}

.result-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.result-error .result-header {
    background: rgba(242, 93, 80, 0.1);
}

.result-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-error .result-title {
    color: var(--danger-red);
}

/* Informações do aluno */
.student-info {
    background: var(--white);
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.student-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.student-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    color: var(--dark);
    font-weight: 500;
}

/* Seção de cobranças pendentes */
.charges-section {
    padding: 1rem;
}

.charges-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--warning-yellow);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.charge-card {
    background: var(--white);
    border: 2px solid var(--warning-yellow);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.charge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

.charge-header {
    background: linear-gradient(135deg, var(--warning-yellow), #e6ac00);
    padding: 1rem 1.5rem;
    color: var(--dark);
}

.charge-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.charge-pending {
    background: linear-gradient(135deg, var(--danger-red), #e84545);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.charge-body {
    padding: 1.5rem;
}

.charge-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.charge-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.charge-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.charge-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.charge-value.amount {
    font-size: 1.3rem;
    color: var(--warning-yellow);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.charge-value.due-date {
    color: var(--danger-red);
    font-weight: 700;
}

.btn-boleto {
    background: linear-gradient(135deg, var(--danger-red), #e84545);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-boleto:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 93, 80, 0.4);
    color: var(--white);
    text-decoration: none;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .card-body {
        padding: 1.5rem;
    }

    .header-content {
        padding: 0 10px;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .charge-details {
        grid-template-columns: 1fr;
    }

    .student-details {
        grid-template-columns: 1fr;
    }

    .alert {
        padding: 12px 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .alert-icon {
        order: -1;
    }

    .alert-text {
        font-size: 14px;
    }
}