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

:root {
    --bg: #0f1115;
    --card: #171a21;
    --border: #262b36;
    --input: #0f1115;

    --text: #ffffff;
    --muted: #9ea6b3;

    --primary-1: #4f7cff;
    --primary-2: #6c63ff;

    --danger-bg: rgba(220, 53, 69, 0.15);
    --danger-border: rgba(220, 53, 69, 0.35);
    --danger-text: #ff8f98;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    -webkit-font-smoothing: antialiased;

    margin: 0;

    padding:
        max(env(safe-area-inset-top), 16px)
        16px
        max(env(safe-area-inset-bottom), 16px);

    display: flex;
    justify-content: center;
    align-items: center;
}

.page-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-card {
    width: 100%;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 24px;

    padding: 26px 22px;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255,255,255,0.02);
}

h1 {
    font-size: 30px;
    font-weight: 700;

    margin-bottom: 8px;
}

.subtitle {
    color: var(--muted);

    line-height: 1.45;

    margin-bottom: 24px;

    font-size: 14px;
}

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

label {
    display: block;

    margin-bottom: 10px;

    font-size: 14px;

    color: #d6dbe4;
}

input {
    width: 100%;

    background: var(--input);

    border: 1px solid #2f3642;

    color: white;

    padding: 15px 16px;

    border-radius: 16px;

    font-size: 16px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

input::placeholder {
    color: #6e7785;
}

input:focus {
    outline: none;

    border-color: var(--primary-1);

    box-shadow:
        0 0 0 4px rgba(91, 140, 255, 0.16);
}

button {
    width: 100%;

    border: none;

    border-radius: 16px;

    padding: 15px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.2s ease,
        filter 0.2s ease;
}

button:active {
    transform: scale(0.985);
}

.primary-btn {
    background:
        linear-gradient(
            135deg,
            var(--primary-1),
            var(--primary-2)
        );

    color: white;
}

.primary-btn:hover:not(:disabled) {
    filter: brightness(1.05);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-btn {
    background: white;
    color: #111318;

    margin-top: 4px;
}

.login-btn:hover:not(:disabled) {
    filter: brightness(0.98);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.otp-section {
    margin-top: 20px;
}

.alert {
    margin-top: 18px;

    padding: 14px 16px;

    border-radius: 14px;

    border: 1px solid var(--danger-border);

    background: var(--danger-bg);

    color: var(--danger-text);

    font-size: 14px;
    line-height: 1.45;
}

.hidden {
    display: none;
}

@media (max-width: 480px) {

    body {
        padding:
            max(env(safe-area-inset-top), 12px)
            12px
            max(env(safe-area-inset-bottom), 12px);
    }

    .page-wrapper {
        max-width: 100%;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 22px;
    }

    h1 {
        font-size: 28px;
    }

    .subtitle {
        margin-bottom: 20px;
    }

    input {
        padding: 14px 15px;
    }

    button {
        padding: 14px;
    }
}
