* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    color: #333;
}

/* Header */
.header {
    background-color: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Floating logout pill in the bottom-right corner */
.logout-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem 0.45rem 0.55rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    font-size: 0.9rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.logout-fab:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

.logout-fab-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
    padding-right: 0.25rem;
    border-right: 1px solid #eef0f3;
}

.logout-fab-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.logout-fab-username {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-fab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    color: #2c3e50;
    background-color: #f4f6f8;
    transition: background-color 0.2s, color 0.2s;
}

.logout-fab-btn:hover {
    background-color: #fdecea;
    color: #b71c1c;
}

.logout-fab-btn svg {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .logout-fab-username {
        display: none;
    }
    .logout-fab-user {
        border-right: none;
        padding-right: 0;
    }
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    background-color: #e0e0e0;
    border: 2px dashed #999;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #777;
    text-align: center;
}

.logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
}

.app-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Main content area */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-left .made-by {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #3498db;
}

.icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: right;
}

.footer-right h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.footer-right p,
.footer-right a {
    font-size: 0.9rem;
    color: #bdc3c7;
    text-decoration: none;
}

.footer-right a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ecf0f1;
    transition: background-color 0.2s;
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .social-links {
        justify-content: flex-start;
    }
}

/* Login Page */
.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.login-button {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #2c3e50;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-button:hover {
    background-color: #34495e;
}

.signup-prompt {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
}

.signup-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.signup-link:hover {
    text-decoration: underline;
}

.form-error {
    background-color: #fdecea;
    color: #b71c1c;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.field-error {
    color: #b71c1c;
    font-size: 0.8rem;
}

.field-help {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Profile Page */
.profile-main {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.profile-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
}

.profile-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.profile-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.profile-section {
    border-top: 1px solid #eee;
    padding: 1.5rem 0;
}

.profile-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin: 1rem 0 0.5rem 0;
}

.section-help {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.form-grid-pairs {
    grid-template-columns: repeat(2, 1fr);
}

.form-group-wide {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.activity-row input,
.ap-row input,
.ap-row select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background-color: #fff;
}

.form-grid input:focus,
.form-grid select:focus,
.activity-row input:focus,
.ap-row input:focus,
.ap-row select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* AP formset rows */
.ap-formset {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ap-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 6px;
}

.ap-delete label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #b71c1c;
    cursor: pointer;
}

.ap-add-button {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    background-color: #ecf0f1;
    border: 1px dashed #aaa;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.ap-add-button:hover {
    background-color: #dfe6e9;
    border-color: #2c3e50;
}

.ap-remove-new {
    align-self: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: #fdecea;
    color: #b71c1c;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ap-remove-new:hover {
    background-color: #f8d7d3;
}

/* Activity rows */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.75rem;
}

.profile-save {
    margin-top: 1.5rem;
    width: 100%;
}

@media (max-width: 600px) {
    .profile-card {
        padding: 1.5rem;
    }
    .form-grid-pairs {
        grid-template-columns: 1fr;
    }
    .activity-row {
        grid-template-columns: 1fr;
    }
    .ap-row {
        grid-template-columns: 1fr;
    }
}
/* Accepto modal */
.modal-overlay {
    position: fixed;
    inset: 0;                              /* covers the whole viewport */
    background-color: rgba(20, 30, 45, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);    /* Safari */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-card {
    position: relative;
    background-color: #ffffff;
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.75rem;
    line-height: 1;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-logo {
    display: block;
    margin: 0 auto 1rem;
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.modal-content {
    min-height: 80px;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modal-button {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.modal-button-primary {
    background-color: #2c3e50;
    color: #ffffff;
}

.modal-button-primary:hover {
    background-color: #34495e;
}

.modal-button-secondary {
    background-color: #ffffff;
    color: #2c3e50;
    border: 1px solid #2c3e50;
}

.modal-button-secondary:hover {
    background-color: #ecf0f1;
}
/* Loading overlay shown while waiting for Accepto */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(20, 30, 45, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #ecf0f1;
    border-top-color: #2c3e50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    font-size: 0.9rem;
    color: #666;
}

/* College tracker dashboard */
.tracker-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tracker-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.filter-group { display: flex; gap: 0.25rem; }
.filter-group.right { margin-left: auto; gap: 0.6rem; }

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s;
}
.filter-btn:hover { background-color: #f1f1f1; }
.filter-btn.active {
    background-color: #fff;
    color: #2c3e50;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
}
.btn-primary { background-color: #2c3e50; color: #fff; }
.btn-primary:hover { background-color: #34495e; }
.btn-secondary { background-color: #fff; color: #555; border-color: #ccc; }
.btn-secondary:hover { background-color: #f7f7f7; }

.tracker-table-wrap {
    overflow-x: auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.tracker-table { width: 100%; border-collapse: collapse; }
.tracker-table th {
    background-color: #fafafa;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
}
.tracker-table th a { color: inherit; text-decoration: none; }
.tracker-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 0.9rem;
}

.school-cell .school-name { font-weight: 600; color: #2c3e50; }
.school-cell .school-major { color: #777; font-size: 0.8rem; }

.tier-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.tier-reach  { background-color: #fdecea; color: #b71c1c; }
.tier-match  { background-color: #fff8e1; color: #b8860b; }
.tier-safety { background-color: #e8f5e9; color: #2e7d32; }

.cell-form { margin: 0; }
.cell-form select,
.cell-form input[type="date"],
.cell-form input[type="text"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background-color: #fff;
    width: 100%;
    min-width: 80px;
}
.cell-form input[type="date"] { min-width: 130px; }
.notes-cell input { min-width: 200px; color: #555; }
.cell-form select:focus,
.cell-form input:focus { outline: none; border-color: #3498db; }

.likelihood-cell { white-space: nowrap; color: #555; }
.portal-link { color: #3498db; text-decoration: none; font-weight: 500; }
.portal-link:hover { text-decoration: underline; }

.days-past { color: #b71c1c; font-weight: 600; }

.btn-remove {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.4rem;
}
.btn-remove:hover { color: #b71c1c; }

.inline-form { display: inline; margin: 0; }

.empty-state {
    text-align: center;
    padding: 2.5rem !important;
    color: #888;
}
/* Add School page */
.add-school-main {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.add-school-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 500px;
}

.autocomplete-wrap {
    position: relative;
    margin: 1.5rem 0 1rem;
}

#school-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}

#school-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-results li {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid #f4f4f4;
}

.autocomplete-results li:last-child { border-bottom: none; }
.autocomplete-results li:hover {
    background-color: #f5f9ff;
    color: #2c3e50;
}

#submit-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Accepto's school summary page */
.summary-main {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.summary-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 1400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    box-sizing: border-box;
}

.summary-row-wrap {
    margin: 0 0 1.5rem;
    box-shadow: none;
    border: 1px solid #eee;
}

.summary-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
}

.summary-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1rem;
}

.summary-message {
    background-color: #f8f9fa;
    border-left: 3px solid #3498db;
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    margin: 0 0 1.5rem;
}

.summary-school {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.5rem;
    text-align: left;
}

.summary-school-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-school .summary-school-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.summary-school .summary-school-major {
    color: #777;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.summary-school-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.summary-school-stats .stat {
    min-width: 0;
}

.summary-school-stats .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-school-stats .stat-value {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
    word-break: break-word;
}

.summary-confirm {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #2c3e50;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.summary-confirm:hover {
    background-color: #34495e;
    color: #ffffff;
}

@media (max-width: 500px) {
    .summary-school-stats {
        grid-template-columns: 1fr;
    }
    .summary-card {
        padding: 1.5rem;
    }
}