/* Responsive común del flujo público de estudiantes */

html,
body {
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

.main-content:not(.welcome-page) {
    width: 100%;
}

.btn,
.time-slot,
input,
select,
textarea {
    touch-action: manipulation;
}

@media (pointer: coarse) {
    .btn,
    .time-slot,
    .btn-float-lang {
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }

    .main-content:not(.welcome-page) {
        padding: 30px 0 calc(28px + env(safe-area-inset-bottom));
    }

    .main-content:not(.welcome-page) > .container {
        width: 100%;
        max-width: 100%;
        padding-inline: max(16px, env(safe-area-inset-left));
    }

    .container-sm {
        max-width: 100%;
    }

    .page-top-text {
        margin-bottom: 18px;
        padding-inline: 8px;
        font-size: .88rem;
        line-height: 1.45;
    }

    .section-header {
        margin-bottom: 24px;
        padding-inline: 6px;
    }

    .section-header .section-icon {
        margin-bottom: 7px;
        font-size: 2.25rem;
    }

    .section-header h1 {
        margin-bottom: 6px;
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.15;
    }

    .section-header p {
        max-width: 34rem;
        margin-inline: auto;
        font-size: .94rem;
        line-height: 1.45;
    }

    .session-duration-notice {
        width: 100%;
        max-width: 100%;
        margin-bottom: 22px;
        padding: 12px 14px;
        gap: 9px;
        border-width: 1px;
        font-size: .92rem;
        line-height: 1.35;
    }

    .session-duration-notice i {
        font-size: 1.15rem;
    }

    .session-duration-notice span {
        font-size: 1rem;
    }

    .form-card {
        width: 100%;
        margin-top: 0;
        padding: 28px 20px;
        border-radius: 18px;
    }

    .form-card-header {
        margin-bottom: 23px;
    }

    .form-card-header i {
        margin-bottom: 8px;
        font-size: 2rem;
    }

    .form-card-header h1 {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .form-card-header p {
        font-size: .9rem;
        line-height: 1.4;
    }

    .form-group {
        margin-bottom: 17px;
    }

    .form-group label {
        margin-bottom: 7px;
        font-size: .9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 50px;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 11px;
    }

    .alert {
        padding: 11px 13px;
        font-size: .86rem;
        line-height: 1.4;
    }

    .form-card .btn-block {
        min-height: 51px;
        margin-top: 4px;
        font-size: 1rem;
    }

    .btn {
        padding: 12px 18px;
        white-space: normal;
        line-height: 1.25;
    }

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

    .btn-float-lang {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
        min-height: 44px;
        padding: 10px 15px;
        font-size: .78rem;
    }

    .professors-grid {
        width: 100%;
        max-width: 430px;
        margin-inline: auto;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .professor-card {
        width: 100%;
        padding: 24px 18px 18px;
        border-radius: 18px;
    }

    .professor-card:hover {
        transform: none;
    }

    .professor-avatar {
        width: 92px;
        height: 92px;
        margin-bottom: 14px;
    }

    .professor-info {
        width: 100%;
        margin-bottom: 15px;
    }

    .professor-info h3 {
        font-size: 1.08rem;
    }

    .professor-info p {
        font-size: .86rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .professor-card .btn {
        min-height: 49px;
        font-size: .95rem;
    }

    .schedule-legend {
        gap: 16px;
        margin-bottom: 20px;
    }

    .legend-item {
        font-size: .82rem;
    }

    .schedule-grid {
        width: 100%;
        gap: 15px;
    }

    .schedule-day {
        width: 100%;
        padding: 17px 14px;
        border-radius: 16px;
    }

    .schedule-day-header {
        gap: 11px;
        margin-bottom: 14px;
        padding-bottom: 11px;
    }

    .schedule-day-number {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 1.12rem;
    }

    .schedule-day-name {
        font-size: .95rem;
    }

    .schedule-day-month {
        font-size: .76rem;
    }

    .time-slots {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .time-slot {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 10px 8px;
        justify-content: center;
        gap: 5px;
        border-radius: 10px;
        font-size: .8rem;
        text-align: center;
        line-height: 1.2;
    }

    .time-slot.selected {
        transform: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .22);
    }

    .reservation-actions {
        width: 100%;
        margin-top: 24px;
        padding: 14px;
        flex-direction: column;
        gap: 9px;
        border-radius: 16px;
        background: rgba(0, 18, 52, .28);
        backdrop-filter: blur(8px);
    }

    .reservation-actions .btn {
        width: 100%;
        min-height: 50px;
    }

    .confirmation-card {
        width: 100%;
        max-width: 100%;
        padding: 35px 20px 28px;
        border-radius: 19px;
    }

    .confirmation-icon {
        margin-bottom: 12px;
        font-size: 3.3rem;
    }

    .confirmation-card h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .confirmation-card > p {
        font-size: .92rem;
        line-height: 1.45;
    }

    .confirmation-card .session-duration-notice {
        margin-block: 17px !important;
    }

    .confirmation-card .btn {
        width: 100%;
        min-height: 50px;
    }

    .student-name {
        overflow-wrap: anywhere;
    }

    .empty-state-public {
        padding: 42px 14px;
        font-size: .92rem;
    }

    .swal2-popup {
        width: min(92vw, 430px) !important;
        padding: 1.35rem !important;
        border-radius: 18px !important;
    }

    .swal2-title {
        padding-inline: 0 !important;
        font-size: 1.35rem !important;
    }

    .swal2-html-container {
        margin-inline: 0 !important;
        font-size: .94rem !important;
    }

    .swal2-actions {
        width: 100%;
        gap: 8px;
    }

    .swal2-actions button {
        flex: 1;
        min-height: 44px;
        margin: 0 !important;
    }
}

@media (max-width: 380px) {
    .main-content:not(.welcome-page) > .container {
        padding-inline: 12px;
    }

    .form-card {
        padding-inline: 16px;
    }

    .session-duration-notice {
        align-items: flex-start;
        text-align: left;
    }

    .time-slots {
        grid-template-columns: 1fr;
    }

    .schedule-day {
        padding-inline: 12px;
    }

    .btn-float-lang {
        max-width: 190px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .main-content:not(.welcome-page) {
        padding-top: 20px;
    }

    .section-header .section-icon {
        display: none;
    }

    .section-header {
        margin-bottom: 18px;
    }

    .btn-float-lang {
        position: absolute;
    }
}
