/* Route65 Premium Styles */
:root {
    --bg-gradient: radial-gradient(circle at top, #1c2738 0%, #05070b 55%, #000000 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-main: #000000;
    --text-light: #ffffff;
    --text-muted: #666666;
    --primary-gradient: linear-gradient(90deg, #007aff, #ff3b30);
    --orange-gradient: linear-gradient(90deg, #ff9500, #ff3b30);
    --dark-gradient: linear-gradient(90deg, #2c3e50, #000000);
    --border-color: #303645;
    --input-border: #bcc2cf;
    --success: #0b8a35;
    --error: #c1272d;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Header --- */
.header {
    text-align: center;
    padding: 20px 15px;
    width: 100%;
    max-width: 600px;
}

.logo {
    width: 140px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.slogan {
    font-size: 0.95rem;
    color: #e0e3ea;
    font-style: italic;
    margin: 5px 0;
}

.subtitle {
    font-size: 0.85rem;
    color: #c7cbd1;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Navigation --- */
.nav-bar {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 999px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: var(--glass-border);
}

.nav-btn {
    padding: 8px 20px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* --- Cards & Containers --- */
.container {
    width: 100%;
    max-width: 500px;
    padding: 0 15px;
    box-sizing: border-box;
}

.card {
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

h2 {
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #111;
}

h3 {
    font-size: 1rem;
    margin: 15px 0 10px 0;
    color: #333;
}

/* --- Forms --- */
label {
    display: block;
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    font-size: 1rem;
    box-sizing: border-box;
    background: #f9f9f9;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    border: none;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 14px;
    background: #eef1f6;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: #007aff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
    margin-top: 10px;
}

.btn-back {
    background: none;
    border: none;
    color: #007aff;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px 0;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-back:hover {
    color: #0051d5;
    transform: translateX(-3px);
}

/* --- Messages --- */
.msg-box {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.msg-box.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.msg-box.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* --- Calculator Specific --- */
.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row span:last-child {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
}

.total-row {
    background: #f0f7ff;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    color: #007aff;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 20px;
}

.text-small {
    font-size: 0.8rem;
    color: #888;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    max-width: 400px;
    text-align: center;
    animation: popIn 0.3s ease-out;
    border: 1px solid #ff3b30;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== PORTAL TILES INTERFACE ========== */

/* Portal Home Container */
.portal-tiles {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    box-sizing: border-box;
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Individual Tile */
.tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.tile:hover::before {
    opacity: 1;
}

.tile:active {
    transform: translateY(-2px);
}

/* Tile Icon */
.tile-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tile Text */
.tile strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.tile span {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.4;
}

/* Tile Color Variants */
.btn-blue {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
}

.btn-orange {
    background: linear-gradient(135deg, #ff9500 0%, #ff3b30 100%);
}

.btn-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Portal Footer */
.portal-footer {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.8;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-footer p {
    margin: 5px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tiles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tile {
        padding: 24px 20px;
    }

    .tile-icon {
        font-size: 2.5rem;
    }

    .tile strong {
        font-size: 1.1rem;
    }

    .tile span {
        font-size: 0.85rem;
    }
}