

/* Root стили */
/* Fonts */
@font-face {
    font-family: "RIVERBOX";
    src: url("fonts/RIVERBOX.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "RIVERTYPES";
    src: url("fonts/RIVERTYPES.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

.fsz24 {
    font-size: 24px;
}

.fsz30 {
    font-size: 30px;
}

/* Margins */
.mt_10 {
    margin-top: 8px;
}

.mr_10 {
    margin-right: 8px;
}

/* Widths */
.w_30 {
    width: 30vw;
}

/* Main стили */

/* Index */
.view-shd {
    display: flex;
    height: 100vh;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 25vw;
    margin: 20px auto;
    padding: 30px;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

.tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    background-color: #2c2c2c;
    color: #ccc;
    border-radius: 6px 6px 0 0;
    transition: background-color 0.3s ease;
}

.tab:first-child {
    border-bottom-left-radius: 6px;
}

.tab:last-child {
    border-bottom-right-radius: 6px;
}

.tab.active {
    background-color: #2979ff;
    color: #fff;
}

.form {
    display: none;
}

.form.active {
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    box-sizing: border-box; /* ← это ключевой момент */
}

input:focus {
    outline: none;
    border-color: #2979ff;
}

button[type="submit"] {
    width: 100%;
    padding: 8px;
    background-color: #2979ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 16px;
}

button[type="submit"]:hover {
    background-color: #1565c0;
}

button[type="submit"]:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.button-custom {
    font-family: "RIVERTYPES", sans-serif;
}

.popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff5252;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1000;
}

.popup.show {
    opacity: 1;
}

.logo-container {
    text-align: center;
    margin: auto 30px auto auto;
}

.logo {
    max-width: 400px;
    height: auto;
}

.logo-mini {
    width: 4vw;
    height: auto;
}

.logo-caption {
    font-family: "RIVERBOX", sans-serif;
    font-size: 48px;
    color: #444;
    margin-top: 10px;
    letter-spacing: 1px;
}

.hint {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* Dashboard */
body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    margin: 0;
    font-family: "RIVERTYPES", sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

.container {
    min-width: 50vw;
    max-width: 65vw;
    margin: 40px auto;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

h1, h2 {
    color: #ffffff;
    margin-bottom: 20px;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header-logo {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 0;
}

a.logout {
    display: inline-block;
    padding: 8px 16px;
    background-color: #942d2d;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

a.logout:hover {
    background-color: #3c74d6;
}

a.initialize {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2979ff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

a.initialize:hover {
    background-color: #3c74d6;
}

a.back {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2979ff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

a.back:hover {
    background-color: #3c74d6;
}

button.pay, button.connect, .renewBtn, button[type="submit"] {
    background-color: #2979ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "✔";
    position: absolute;
    top: -1.5px;
    left: 2px;
    font-size: 14px;
    color: white;
}

.checkbox-label a {
    position: relative;
    color: #4CAF50;
    text-decoration: underline;
    left: -6px;
}

.checkbox-label a:hover {
    text-decoration: none;
}

button.pay:hover, .renewBtn:hover, button[type="submit"]:hover {
    background-color: #1565c0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #2c2c2c;
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background-color: #424242;
    font-size: 16px;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #333;
}

table tr:hover {
    background-color: #333;
}

table th,
table td {
    text-align: center;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:last-child:hover td {
    border-bottom: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    top: 50vh;
    transform: translateY(-50%);
    background-color: #1e1e1e;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    color: #e0e0e0;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.modal-content-info {
    display: flex;
    flex-direction: row;
    gap: 40px;
    position: relative;
    top: 50vh;
    transform: translateY(-50%);
    background-color: #1e1e1e;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 900px;
    color: #e0e0e0;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content select, .modal-content input {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background-color: #2c2c2c;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
}

.modal-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 410px;
}

.modal-instr {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 390px;
}

.modal-instr p {
    margin: 0;
}

.close, .close-renew, .close-qr, .close-seller {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close-renew:hover, .close-qr:hover {
    color: #fff;
}

/* Icons стили */
.device-icon {
    transition: transform 0.3s ease, color 0.3s ease;
    color: #555;
}

.device-icon:hover {
    transform: scale(1.2) rotate(5deg);
    color: #007bff;
}

/* QR стили */
#qrLink {
    display: block;
    word-break: break-all;
    font-size: 14px;
    color: #0077cc;
    text-align: center;
    margin-top: 10px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-decoration: underline;
}

#qrModal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 20px 0 20px;
}

#qrImage {
    max-width: 250px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 0 10px rgb(20, 0, 255);
}

/* Code стили */

.code-block {
    background-color: #1e1e1e;
    color: #dcdcdc;
    padding: 20px 10px 20px 10px;
    border-radius: 8px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    overflow-x: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    max-width: 600px;
    margin: 20px auto;
}

.code-block::before {
    content: "Ссылка для подключения";
    display: block;
    color: #0077cc;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

/* Footer стили */

footer {
    text-align: center;
    padding: 15px;
    font-size: 14px;
}

footer a {
    margin: 0 10px;
    color: #333;
    text-decoration: none;
}

footer nr {
    margin: 0 10px;
    color: #333;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.responsive-table {
    border-collapse: collapse;
}

.show-on-mobile {
    display: none !important;
}

.show-on-pc {
    display: inline-block !important;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

.pagination {
    margin: 15px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background: #e0e0e0;
    color: #007bff;
}

.pagination .active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    pointer-events: none;
}

#sidebar-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    background: #333;
    color: white;
    padding: 8px;
    cursor: pointer;
    z-index: 1000;
    border-radius: 4px;
}

side_info {
    position: fixed;
    left: 0;
    width: 20vw;
    height: 100vh;
    overflow-y: hidden;
    transition: transform 0.3s ease;
    z-index: 999;
}

side_info.collapsed {
    transform: translateX(-100%);
}

side_info.expanded {
    transform: translateX(0);
}

server {
    display: flex;
    width: 15vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 320px;
    max-width: 500px;
    margin-left: 1vw;
    margin-right: auto;
}

.server-card {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.server-info-row {
    display: flex;
    margin-bottom: 8px;
}

.server-info-title {
    font-weight: bold;
    min-width: 120px;
    color: #ffffff;
}

.server-info-value {
    color: #555;
}

@media screen and (max-height: 900px) {
    #sidebar-toggle {
        display: none;
    }

    .view-shd {
        display: flex;
        height: 100vh;
        flex-direction: row;
        align-items: center;
    }

    .logo-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: 0;
        margin: auto;
    }

    .auth-container {
        display: flex;
        flex-direction: column;
    }
    
    button.connect {
        margin-top: 8vh;
    }
}

@media screen and (max-width: 480px) {
    #sidebar-toggle {
        display: none;
    }
    
    server {
        display: none;
    }

    .view-shd {
        display: flex;
        height: 90vh;
        flex-direction: column;
        align-items: center;
    }

    .logo-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100vw;
        text-align: center;
        margin-top: 30px;
    }

    .logo {
        width: 45vw;
        height: auto;
    }

    .logo-caption {
        font-family: "RIVERBOX", sans-serif;
        font-size: 24px;
        color: #444;
        margin-top: 10px;
        margin-bottom: 20px;
        letter-spacing: 1px;
    }

    .auth-container {
        position: relative;
        width: 80vw;
        margin: auto;
        padding: 15px;
        background-color: #1e1e1e;
        border-radius: 12px;
        box-shadow: 0 0 15px rgba(0,0,0,0.6);
    }

    body {
        min-height: 0;
        font-size: 12px;
    }

    footer {
        padding: 5px;
        font-size: 12px;
    }

    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 80vw;
        margin: 40px auto;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 15px;
        background-color: #333;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        padding: 10px;
    }

    .responsive-table tr:last-child {
        margin-bottom: 0;
    }

    .responsive-table td {
        display: block;
        text-align: center;
        padding: 6px 10px;
        position: relative;
    }

    .responsive-table th:first-child,
    .responsive-table td:first-child {
        display: none;
    }

    .modal-content {
        position: relative;
        background-color: #1e1e1e;
        margin: 10% auto;
        padding: 20px;
        border-radius: 8px;
        width: 85vw;
        color: #e0e0e0;
        box-shadow: 0 0 15px rgba(0,0,0,0.5);
        font-size: 12px;
    }

    .modal-info {
        width: 100%;
    }

    .modal-instr {
        width: 100%;
    }

    .modal-content-info {
        display: flex;
        flex-direction: column;
        position: relative;
        top: 50vh;
        transform: translateY(-54%);
        background-color: #1e1e1e;
        margin: auto;
        padding: 20px;
        border-radius: 8px;
        width: 85vw;
        color: #e0e0e0;
        box-shadow: 0 0 15px rgba(0,0,0,0.5);
        height: 82vh;
        overflow: auto;
    }

    .modal-content select, .modal-content input {
        width: 100%;
        padding: 8px;
        margin-top: 8px;
        background-color: #2c2c2c;
        color: #fff;
        border: 1px solid #555;
        border-radius: 4px;
        font-size: 12px;
    }

    .code-block {
        margin: 20px 0 -20px 0;
    }

    .checkbox-label {
        font-size: 12px;
    }
    
    .checkbox-label input[type="checkbox"] {
        font-size: 12px;
    }
    
    .checkbox-label input[type="checkbox"]:checked::after {
        content: "✔";
        position: absolute;
        top: -1.5px;
        left: 2px;
        font-size: 14px;
        color: white;
    }

    @supports (-moz-appearance: none) {
        .checkbox-label input[type="checkbox"]:checked::after {
            top: -2px;
        }
    }

    .info {
        text-align: center;    
    }

    .mobile {
        text-align: center;
    }

    .show-on-mobile {
        display: inline-block !important;
    }

    .show-on-pc {
        display: none !important;
    }
    
    button.connect {
        margin-top: 8vh;
    }
}

@media screen and (min-width: 481px) and (max-width: 720px) {
    #sidebar-toggle {
        display: none;
    }
    
    server {
        display: none;
    }

    .view-shd {
        display: flex;
        height: 90vh;
        flex-direction: column;
        align-items: center;
    }
        
    .logo-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100vw;
        text-align: center;
        margin-top: 30px;
    }

    .logo {
        width: 45vw;
        height: auto;
    }

    .logo-caption {
        font-family: "RIVERBOX", sans-serif;
        font-size: 24px;
        color: #444;
        margin-top: 10px;
        margin-bottom: 20px;
        letter-spacing: 1px;
    }

    .auth-container {
        position: relative;
        width: 80vw;
        margin: auto;
        padding: 15px;
        background-color: #1e1e1e;
        border-radius: 12px;
        box-shadow: 0 0 15px rgba(0,0,0,0.6);
    }

    body {
        min-height: 0;
        font-size: 12px;
    }

    footer {
        padding: 5px;
        font-size: 14px;
    }

    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 80vw;
        margin: 40px auto;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 15px;
        background-color: #333;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        padding: 10px;
    }

    .responsive-table tr:last-child {
        margin-bottom: 0;
    }

    .responsive-table td {
        display: block;
        text-align: center;
        padding: 6px 10px;
        position: relative;
    }

    .responsive-table th:first-child,
    .responsive-table td:first-child {
        display: none;
    }

    .modal-content {
        position: relative;
        background-color: #1e1e1e;
        margin: 10% auto;
        padding: 20px;
        border-radius: 8px;
        width: 85vw;
        color: #e0e0e0;
        box-shadow: 0 0 15px rgba(0,0,0,0.5);
        font-size: 14px;
    }


    .modal-info {
        width: 100%;
    }

    .modal-instr {
        width: 100%;
    }

    .modal-content-info {
        display: flex;
        flex-direction: column;
        position: relative;
        top: 50vh;
        transform: translateY(-54%);
        background-color: #1e1e1e;
        margin: auto;
        padding: 20px;
        border-radius: 8px;
        width: 85vw;
        color: #e0e0e0;
        box-shadow: 0 0 15px rgba(0,0,0,0.5);
        height: 82vh;
        overflow: auto;
    }

    .modal-content select, .modal-content input {
        width: 100%;
        padding: 8px;
        margin-top: 8px;
        background-color: #2c2c2c;
        color: #fff;
        border: 1px solid #555;
        border-radius: 4px;
        font-size: 12px;
    }

    .code-block {
        margin: 20px 0 -20px 0;
    }

    .modal-content select, .modal-content input {
        width: 100%;
        padding: 8px;
        margin-top: 8px;
        background-color: #2c2c2c;
        color: #fff;
        border: 1px solid #555;
        border-radius: 4px;
        font-size: 14px;
    }

    .checkbox-label {
        font-size: 14px;
    }
    
    .checkbox-label input[type="checkbox"] {
        font-size: 14px;
    }
    
    .checkbox-label input[type="checkbox"]:checked::after {
        content: "✔";
        position: absolute;
        top: -1.5px;
        left: 2px;
        font-size: 14px;
        color: white;
    }

    @supports (-moz-appearance: none) {
        .checkbox-label input[type="checkbox"]:checked::after {
            top: -2px;
        }
    }

    .info {
        text-align: center;    
    }

    .mobile {
        text-align: center;
    }

    .show-on-mobile {
        display: inline-block !important;
    }

    .show-on-pc {
        display: none !important;
    }
    
    button.connect {
        margin-top: 8vh;
    }
}

