@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --redirect-bg-1: #07090f;
    --redirect-bg-2: #0b1f2f;
    --redirect-bg-3: #112e4a;
    --redirect-highlight: #47d8ff;
    --redirect-highlight-2: #31ffb2;
    --redirect-card: rgba(6, 10, 20, 0.65);
    --redirect-card-border: rgba(71, 216, 255, 0.3);
    --redirect-text: #ebf4ff;
    --redirect-muted: rgba(235, 244, 255, 0.65);
    --redirect-success: #1ed2a7;
    --redirect-error: #ff6b6b;
}

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

body.redirect-theme {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, var(--redirect-bg-3), var(--redirect-bg-2) 45%, var(--redirect-bg-1));
    background-attachment: fixed;
    overflow: hidden;
}

body.redirect-theme::before,
body.redirect-theme::after {
    content: '';
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(71, 216, 255, 0.3), transparent 60%);
    filter: blur(18px);
    animation: orbit 18s linear infinite;
    z-index: 0;
}

body.redirect-theme::after {
    animation-delay: -9s;
    background: radial-gradient(circle, rgba(49, 255, 178, 0.25), transparent 60%);
}

@keyframes orbit {
    0% { transform: translate(-30%, -30%) scale(0.85); }
    50% { transform: translate(35%, 25%) scale(1.05); }
    100% { transform: translate(-30%, -30%) scale(0.85); }
}

.redirect-theme .form-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 48px 42px;
    border-radius: 28px;
    background: var(--redirect-card);
    border: 1px solid var(--redirect-card-border);
    backdrop-filter: blur(22px);
    box-shadow: 0 40px 80px rgba(7, 9, 15, 0.65);
    color: var(--redirect-text);
    text-align: center;
    z-index: 1;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.redirect-theme .form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 50px 100px rgba(7, 9, 15, 0.75);
}

.redirect-theme .form-header {
    margin-bottom: 32px;
}

.redirect-theme .form-header h2 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 1px;
}

.redirect-theme .form-header p {
    margin-top: 6px;
    font-size: 14px;
    color: var(--redirect-muted);
}

.redirect-theme .input-group {
    position: relative;
    margin-bottom: 24px;
}

.redirect-theme .input-field {
    width: 100%;
    padding: 14px 16px 14px 52px;
    border-radius: 16px;
    border: 1px solid rgba(235, 244, 255, 0.18);
    background: rgba(10, 14, 24, 0.6);
    color: var(--redirect-text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.redirect-theme .input-field::placeholder {
    color: rgba(235, 244, 255, 0.4);
}

.redirect-theme .input-field:focus {
    border-color: var(--redirect-highlight);
    box-shadow: 0 0 25px rgba(71, 216, 255, 0.25);
    transform: translateY(-2px);
}

.redirect-theme .input-group .icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(235, 244, 255, 0.35);
    transition: color 0.3s ease;
    pointer-events: none;
}

.redirect-theme .input-field:focus + .icon {
    color: var(--redirect-highlight);
}

.redirect-theme select.input-field {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ebf4ff' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 18px) center;
}

.redirect-theme #submitBtn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(120deg, var(--redirect-highlight), var(--redirect-highlight-2));
    color: #062135;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 15px 40px rgba(71, 216, 255, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.redirect-theme #submitBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(71, 216, 255, 0.45);
}

.redirect-theme #submitBtn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.6);
    box-shadow: none;
}

.redirect-theme .spinner {
    border: 3px solid rgba(6, 33, 53, 0.4);
    border-top-color: rgba(6, 33, 53, 0.9);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

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

.redirect-theme .message {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 22px;
    display: none;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.redirect-theme .message.success {
    display: block;
    border-color: rgba(30, 210, 167, 0.45);
    color: var(--redirect-success);
    background: rgba(30, 210, 167, 0.08);
}

.redirect-theme .message.error {
    display: block;
    border-color: rgba(255, 107, 107, 0.45);
    color: var(--redirect-error);
    background: rgba(255, 107, 107, 0.08);
}

@media (max-width: 520px) {
    body.redirect-theme {
        padding: 16px;
    }

    .redirect-theme .form-card {
        padding: 36px 28px;
    }

    .redirect-theme .input-field {
        padding-left: 48px;
    }
}

/* =========================================================
   PORTAL LAYOUT (Dashboard estilo DNS)
   ========================================================= */

body.redirect-theme.portal-layout {
    padding: 0;
    display: block;
}

.portal-layout .portal-shell {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: 230px;
    padding: 24px 18px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.96));
    border-right: 1px solid rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.portal-logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--redirect-highlight), var(--redirect-highlight-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #031322;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.portal-brand-title {
    font-size: 15px;
    font-weight: 600;
    color: #e5edff;
}

.portal-brand-subtitle {
    font-size: 11px;
    color: rgba(226, 232, 255, 0.6);
}

.portal-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
    color: rgba(226, 232, 255, 0.8);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.portal-menu-item .icon {
    font-size: 14px;
}

.portal-menu-item:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: translateX(2px);
}

.portal-menu-item.active {
    background: radial-gradient(circle at left, rgba(71, 216, 255, 0.32), transparent 60%);
    color: #f9fbff;
}

.portal-sidebar-footer {
    margin-top: 32px;
    display: flex;
    justify-content: flex-start;
}

.portal-version-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.9);
    color: rgba(226, 232, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.portal-main {
    flex: 1;
    padding: 40px 32px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.portal-topbar {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 6px auto;
}

.portal-topbar-title h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--redirect-text);
    margin-bottom: 4px;
}

.portal-topbar-title p {
    font-size: 13px;
    color: var(--redirect-muted);
}

.portal-card {
    margin-top: 26px;
    border-radius: 20px;
    background: var(--redirect-card);
    border: 1px solid var(--redirect-card-border);
    box-shadow: 0 24px 60px rgba(3, 7, 18, 0.75);
    padding: 22px 22px 24px 22px;
    width: 100%;
    max-width: 1100px;
}

.portal-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.portal-card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.portal-card-header p {
    font-size: 13px;
    color: var(--redirect-muted);
}

.portal-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-primary-btn {
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(120deg, var(--redirect-highlight), var(--redirect-highlight-2));
    color: #031322;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 28px rgba(71, 216, 255, 0.4);
}

.portal-primary-btn:hover {
    transform: translateY(-1px);
}

.portal-table-wrapper {
    margin-top: 4px;
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.portal-table thead tr {
    background: rgba(15, 23, 42, 0.9);
}

.portal-table th,
.portal-table td {
    padding: 10px 10px;
    text-align: left;
}

.portal-table th {
    font-weight: 600;
    color: rgba(226, 232, 255, 0.9);
    font-size: 12px;
}

.portal-table tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.7);
}

.portal-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.5);
}

.portal-table tbody tr:hover {
    background: rgba(71, 216, 255, 0.07);
}

.portal-table .input-field {
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.portal-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 235, 0.12);
    border: 1px solid rgba(34, 197, 235, 0.65);
    color: rgba(226, 242, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
}

.portal-tag-secondary {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.7);
}

.portal-tag-info {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.7);
}

.portal-action-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: rgba(226, 232, 255, 0.92);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.portal-action-btn:hover {
    border-color: rgba(71, 216, 255, 0.9);
}

@media (max-width: 900px) {
    .portal-layout .portal-shell {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 14px 16px;
    }

    .portal-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .portal-main {
        padding: 18px 16px 22px 16px;
        align-items: stretch;
    }
}

/* Login page - modern glassmorphism style */
body.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, #020617 0%, #0f172a 40%, #020617 100%);
    background-attachment: fixed;
    overflow: hidden;
    position: relative;
    color: #e5e7eb;
}

body.login-page #spline-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

body.login-page #spline-scene canvas {
    width: 100%;
    height: 100%;
    display: block;
}

body.login-page #toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 3;
}

body.login-page .login-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 40px 36px 36px 36px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(22px);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.9);
    text-align: center;
    z-index: 1;
}

body.login-page .login-header {
    margin-bottom: 28px;
}

body.login-page .login-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.login-page .login-subtitle {
    margin-top: 4px;
    font-size: 14px;
    color: #94a3b8;
}

body.login-page .login-form-group {
    margin-bottom: 20px;
}

body.login-page .login-form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

body.login-page .login-form-control::placeholder {
    color: rgba(235, 244, 255, 0.4);
}

body.login-page .login-form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

body.login-page .btn-login {
    width: 100%;
    padding: 15px;
    margin-top: 4px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #f9fafb;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

body.login-page .btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(79, 70, 229, 0.6);
}

body.login-page .btn-login:active {
    transform: translateY(-1px);
}

body.login-page .error-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 107, 107, 0.45);
    color: var(--redirect-error);
    background: rgba(255, 107, 107, 0.08);
    backdrop-filter: blur(10px);
}

@media (max-width: 520px) {
    body.login-page {
        padding: 16px;
    }

    body.login-page .login-wrapper {
        padding: 32px 24px 28px 24px;
    }
}
