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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f1117;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.screen {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.card {
    background-color: #1e2030;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

input[type="password"] {
    background-color: #2a2d3e;
    border: 1px solid #3a3d4e;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

input[type="password"]:focus {
    border-color: #4f7cf7;
}

button {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: opacity 0.2s, transform 0.1s;
}

button:hover:not(:disabled) {
    opacity: 0.85;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

#login-form button[type="submit"] {
    background-color: #4f7cf7;
    color: #fff;
    width: 100%;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #3a3d4e;
    color: #888;
    font-size: 0.875rem;
    padding: 0.4rem 0.9rem;
}

.status-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background-color: #2a2d3e;
    border-radius: 8px;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-unknown { background-color: #555; }

.status-running {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.status-stopped { background-color: #ef4444; }

.status-transitioning {
    background-color: #f59e0b;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e0e0e0;
    text-transform: capitalize;
}

.controls {
    display: flex;
    gap: 1rem;
}

.btn-start {
    background-color: #166534;
    color: #86efac;
    flex: 1;
}

.btn-start:hover:not(:disabled) {
    background-color: #15803d;
    opacity: 1;
}

.btn-stop {
    background-color: #7f1d1d;
    color: #fca5a5;
    flex: 1;
}

.btn-stop:hover:not(:disabled) {
    background-color: #991b1b;
    opacity: 1;
}

.ssh-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #12141f;
    border-radius: 6px;
    border: 1px solid #2a2d3e;
}

.ssh-command {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    color: #86efac;
    word-break: break-all;
}

.btn-copy {
    background-color: #2a2d3e;
    border: 1px solid #3a3d4e;
    color: #888;
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-copy:hover:not(:disabled) {
    opacity: 1;
    background-color: #3a3d4e;
    color: #e0e0e0;
}

.btn-copy.copied {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.5);
}

.sg-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #2a2d3e;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sg-label {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
}

.sg-ip {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    color: #e0e0e0;
    text-align: right;
}

.btn-lock-ssh {
    background-color: #1e3a5f;
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.3);
    width: 100%;
    font-size: 0.9rem;
}

.btn-lock-ssh:hover:not(:disabled) {
    background-color: #1d4ed8;
    color: #fff;
    opacity: 1;
}

.btn-lock-ssh.locked {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.5);
    background-color: #14532d;
}

#action-error {
    margin-top: 1rem;
    margin-bottom: 0;
}
