:root {
    --modal-bg: #222222;
    --overlay-bg: rgba(0, 0, 0, 0.75);
    --text-primary: #ffffff;
    --text-gray: #878787;
    --text-secondary: #8a8f98;
    --button-bg: #ab9ff2;
    --button-hover-bg: #e2dffe; 
    --input-bg: #181818;
    --border-radius: 12px;
    --input-border: #2f2f2f;
    --text-button: #000000;
    --invalid-border: #eb3742;
}

.seed-modal-overlay * {
    font-family: "Roboto", "Arial", sans-serif;
}

.modal-overlay * {
    font-family: "Roboto", "Arial", sans-serif;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.logo-container {
    display: flex;
}

.modal-container {
    background-color: var(--modal-bg);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phantom-svg {
    width: 94px;
    height: auto;
}

.header-svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease-in-out;
} 

.header-buttons:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-buttons:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 93, 211, 0.5);
}

.header-buttons:active {
    transform: scale(0.95);
}

.header-buttons:focus-visible {
    outline: 2px solid #6c5dd3;
    outline-offset: 2px;
}

.modal-question:hover .header-svg {
    stroke: #ffffff;
}

.modal-title {
    color: var(--text-gray);
    font-size: 16px;
    font-weight: 500;
}

.header-buttons {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 100px;
    color: #8a8f98;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.modal-content {
    padding: 20px;
    text-align: center;
}

.ghost-logo {
    margin: 0 auto 20px;
    position: relative;
}

.ghost-logo img {
    width: 130px;
    height: auto;
}

.modal-heading {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 500;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 400;
}

.modal-button-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-button-text:hover {
    color: var(--text-primary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-input {
    background-color: var(--input-bg);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 16px;
    width: 100%;
}

.modal-input::placeholder {
    color: var(--text-secondary);
}

.forgot-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    text-align: left;
}

.phantom-button {
    background-color: var(--button-bg);
    color: var(--text-button);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    font-weight: 500;
}

.phantom-button:disabled {
    cursor: not-allowed;
    opacity: 70%;
}

.phantom-button:hover {
    background-color: var(--button-hover-bg);
}

.seed-phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-number {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 1;
}

.seed-input {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 12px 14px 12px 35px;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
}

.seed-input.invalid {
    border-color: var(--invalid-border);
}

.seed-input::placeholder {
    color: var(--text-secondary);
}

.seed-input:focus {
    outline: none;
    border-color: var(--button-bg);
    background-color: #1b1b1b;
}

.seed-input:hover {
    background-color: #1b1b1b;
}

.hidden {
    display: none;
}

.mb-20 {
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .modal-container {
        margin: 16px;
    }
    
    .modal-heading {
        font-size: 16px;
    }

    .modal-text {
        font-size: 14px;
    }

    .modal-button-text {
        font-size: 14px;
    }

    .seed-phrase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .seed-input {
        font-size: 13px;
        padding: 10px 14px 10px 32px;
    }

    .input-number {
        font-size: 13px;
        left: 10px;
    }
}

@media (max-height: 800px) {
    .modal-container {
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-content {
        overflow-y: auto;
        max-height: calc(90vh - 64px);
        margin-right: 2px;
    }
    
    .modal-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .modal-content::-webkit-scrollbar-track {
        background: var(--modal-bg);
        border-radius: 3px;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
        background: var(--button-bg);
        border-radius: 3px;
        transition: background 0.2s ease;
    }
    
    .modal-content::-webkit-scrollbar-thumb:hover {
        background: var(--button-hover-bg);
    }
    
    .modal-content {
        scrollbar-width: thin;
        scrollbar-color: var(--button-bg) var(--modal-bg);
    }
}

@media (max-height: 600px) {
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-content {
        max-height: calc(95vh - 64px);
    }
    
    .ghost-logo img {
        width: 100px;
    }
    
    .ghost-logo {
        margin-bottom: 12px;
    }
}

@media (max-height: 800px) and (orientation: landscape) {
    .seed-phrase-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.modal-loading-form {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ghost-loading {
    position: relative;
    animation: ghostFloat 2.5s ease-in-out infinite;
}

.ghost-loading img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.1));
}

@keyframes ghostFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-15px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
}

.ghost-loading::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(171, 159, 242, 0.2) 0%, rgba(171, 159, 242, 0) 70%);
    bottom: -20px;
    left: 0;
    border-radius: 50%;
    animation: shadowPulse 2.5s ease-in-out infinite;
}

@keyframes shadowPulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.ghost-loading img {
    position: relative;
}

.ghost-loading img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(171, 159, 242, 0) 0%, rgba(171, 159, 242, 0.1) 100%);
    animation: glowPulse 2s ease-in-out infinite;
    border-radius: inherit;
}

@keyframes glowPulse {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}