/* MintStudio Portal — стили вынесены из portal-index.html */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.background-decorations::before,
.background-decorations::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgb(19, 91, 147);
    opacity: 0.03;
    filter: blur(40px);
}

.background-decorations::before {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
}

.background-decorations::after {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -200px;
}

.login-section.active,
.dashboard-section.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
}

footer {
    pointer-events: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    z-index: 10;
    animation: fadeInUp 0.6s ease-out 1.5s forwards;
}

footer > div {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

footer p {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

.portal-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.portal-container.dashboard-mode {
    max-width: 1200px;
}

.login-section, .dashboard-section {
    padding: 48px;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-section.active, .dashboard-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.header {
    text-align: center;
    margin-bottom: 48px;
}

/* Логотип и заголовок в шапке логина */
.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.header-logo {
    width: 64px;
    height: 64px;
    animation: logoFloat 3s ease-in-out infinite 1s;
}

.header-title {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: rgb(19, 91, 147);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.header p {
    color: #64748b;
    font-size: 1.125rem;
    font-weight: 400;
}

.header-subtitle {
    font-size: 0.875rem;
    color: rgb(19, 91, 147);
    font-weight: 600;
    margin-top: 4px;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.login-form {
    max-width: 420px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out 0.8s both;
    opacity: 0;
    transform: translateY(20px);
}

.login-form .error-message {
    animation: fadeInUp 0.4s ease-out 1s both;
    opacity: 0;
    transform: translateY(20px);
}

.login-form .form-group:nth-of-type(1) {
    animation: fadeInUp 0.5s ease-out 1s both;
    opacity: 0;
    transform: translateY(20px);
}

.login-form .form-group:nth-of-type(2) {
    animation: fadeInUp 0.5s ease-out 1.2s both;
    opacity: 0;
    transform: translateY(20px);
}

.login-form .login-btn {
    animation: fadeInUp 0.5s ease-out 1.4s both;
    opacity: 0;
    transform: translateY(20px);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: rgb(19, 91, 147);
    box-shadow: 0 0 0 3px rgba(19, 91, 147, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group input:hover {
    border-color: #9ca3af;
}

.login-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgb(19, 91, 147);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(19, 91, 147, 0.25);
    font-family: inherit;
}

.login-btn:hover:not(:disabled) {
    background: rgb(30, 120, 180);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(19, 91, 147, 0.3);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(19, 91, 147, 0.15);
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.system-card.anim-card-1 { animation: fadeInUp 0.6s ease-out 0.8s both; }
.system-card.anim-card-2 { animation: fadeInUp 0.6s ease-out 1s both; }
.system-card.anim-card-3 { animation: fadeInUp 0.6s ease-out 1.1s both; }
.system-card.anim-card-4 { animation: fadeInUp 0.6s ease-out 1.3s both; }

.system-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.system-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgb(19, 91, 147);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.system-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: rgb(235, 245, 252);
}

.system-card:hover::before {
    transform: scaleX(1);
}

.system-card:active {
    transform: translateY(-2px) scale(0.98);
    transition-duration: 0.1s;
}

.system-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.8;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgb(19, 91, 147), rgb(30, 120, 180));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.system-card:hover .system-icon {
    opacity: 1;
    transform: scale(1.05);
}

.system-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.system-description {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.status-online {
    background: #dcfce7;
    color: #166534;
}

.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
}

.status-offline {
    background: #fef2f2;
    color: #dc2626;
}

.status-offline::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.3);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.logout-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.logout-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.loading {
    text-align: center;
    color: #6b7280;
    font-weight: 500;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid rgb(19, 91, 147);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 24px auto;
}

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

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .systems-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 24px;
    }

    .portal-container {
        margin: 0;
        border-radius: 12px;
        max-width: none;
    }

    .portal-container.dashboard-mode {
        max-width: none;
    }

    .login-section, .dashboard-section {
        padding: 32px 24px;
    }

    .header {
        margin-bottom: 32px;
    }

    .header h1 {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 1rem;
    }

    .login-form {
        max-width: none;
    }

    .system-card {
        padding: 24px;
    }

    .system-icon {
        font-size: 2.5rem;
        margin-bottom: 16px;
    }

    .system-title {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .system-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .logout-btn {
        top: 16px;
        right: 16px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    footer {
        bottom: 12px;
    }

    footer > div {
        padding: 6px 12px;
    }

    footer p {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .background-decorations::before,
    .background-decorations::after {
        width: 200px;
        height: 200px;
        opacity: 0.02;
    }

    .portal-container {
        margin: 0;
        border-radius: 8px;
        max-width: none;
    }

    .portal-container.dashboard-mode {
        max-width: none;
    }

    .login-section, .dashboard-section {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .header {
        margin-bottom: 24px;
    }

    .systems-grid {
        gap: 16px;
        margin-top: 20px;
    }

    .system-card {
        padding: 20px;
    }

    footer {
        bottom: 8px;
    }

    footer > div {
        padding: 4px 8px;
        border-radius: 12px;
    }

    footer p {
        font-size: 0.65rem;
    }
}
