﻿
/* ================================================================
           RESET & GLOBAL
           ================================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: linear-gradient(135deg, #e8f5ec 0%, #f0f4f8 100%);
    min-height: 100vh;
    padding: 30px 15px;
    color: #1e2f40;
    line-height: 1.5;
    font-size: 16px;
}

/* Font Awesome icon protection */
.fas, .fa-solid, .far, .fa-regular, .fab, .fa-brands, .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-weight: 900;
    font-style: normal;
    display: inline-block;
    line-height: 1;
}

.fab, .fa-brands {
    font-weight: 400;
}

input, select, textarea, button {
    font-size: 16px;
    font-family: inherit;
}

/* ================================================================
           REGISTRATION CARD
           ================================================================ */
.reg-wrap {
    max-width: 780px;
    margin: 0 auto;
}

.reg-card {
    background: #fff;
    border-radius: 24px;
    padding: 2rem 2.2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08), 0 0 0 1px rgba(22,163,74,0.05);
    border: 1px solid #e9edf2;
    position: relative;
    overflow: hidden;
}

    .reg-card::before {
        content: '';
        position: absolute;
        top: -60px;
        right: -60px;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(163,230,53,0.15), transparent 70%);
        pointer-events: none;
    }

.reg-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #145c3e;
    text-align: center;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .reg-title i {
        color: #16a34a;
    }

.reg-subtitle {
    color: #6b7c8e;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ================================================================
           FORM GRID
           ================================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    min-width: 0;
}

    .form-group label {
        display: block;
        font-weight: 600;
        font-size: 0.85rem;
        color: #1e2f40;
        margin-bottom: 6px;
    }

        .form-group label .req {
            color: #e74c3c;
            margin-left: 2px;
            font-weight: 700;
        }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 11px 14px;
        border: 1.5px solid #dde4ec;
        border-radius: 12px;
        font-size: 16px;
        background: #f9fcff;
        outline: none;
        transition: border 0.2s, box-shadow 0.2s;
        font-family: inherit;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-group select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c8e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        padding-right: 36px;
        cursor: pointer;
    }

    .form-group textarea {
        resize: vertical;
        min-height: 70px;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: #16a34a;
            box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
            background: #fff;
        }

/* Inline validation errors */
.validation-error {
    display: block;
    color: #e74c3c;
    font-size: 0.75rem;
    margin-top: 5px;
    font-weight: 500;
}

/* ================================================================
           OTP CHANNEL RADIO
           ================================================================ */
.otp-channel-wrap {
    margin-top: 4px;
    padding: 12px 16px;
    background: #f8fdfa;
    border: 1.5px dashed #bbf7d0;
    border-radius: 12px;
}

    .otp-channel-wrap > label.main-label {
        display: block;
        font-weight: 600;
        font-size: 0.85rem;
        color: #1e2f40;
        margin-bottom: 10px;
    }

        .otp-channel-wrap > label.main-label .req {
            color: #e74c3c;
            margin-left: 2px;
            font-weight: 700;
        }

.otp-channel {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

    .otp-channel label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 500;
        font-size: 0.92rem;
        cursor: pointer;
        color: #1e2f40;
        padding: 6px 4px;
        white-space: nowrap;
    }

    .otp-channel input[type="radio"] {
        accent-color: #16a34a;
        width: 18px;
        height: 18px;
        cursor: pointer;
        margin: 0;
    }

/* ================================================================
           ALERTS
           ================================================================ */
.alert {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 18px;
    text-align: center;
    word-wrap: break-word;
}

.alert-danger {
    background: #fdecea;
    color: #b02a37;
    border: 1px solid #f5c2c7;
}

.alert-success {
    background: #e6f7ec;
    color: #1e7d4a;
    border: 1px solid #b9e6c9;
}

/* ================================================================
           BUTTONS
           ================================================================ */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 13px 20px;
    border-radius: 60px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
    margin-top: 22px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(145deg, #16a34a, #0d7a3a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(22,163,74,0.35);
}

    .btn-primary:hover {
        background: linear-gradient(145deg, #0d7a3a, #085e2b);
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

/* ================================================================
           FOOTER LINKS
           ================================================================ */
.reg-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.85rem;
    color: #5b6b7c;
    line-height: 1.7;
}

    .reg-footer a {
        color: #16a34a;
        font-weight: 600;
        text-decoration: none;
    }

        .reg-footer a:hover {
            text-decoration: underline;
        }

    .reg-footer .divider {
        margin: 0 8px;
        color: #cbd5e1;
    }
/* Password strength meter */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 6px;
    background: #e9edf2;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

    .strength-bar span {
        display: block;
        height: 100%;
        width: 0%;
        background: #e74c3c;
        border-radius: 3px;
        transition: width 0.3s, background 0.3s;
    }

.password-strength small {
    font-size: 0.72rem;
    font-weight: 600;
    display: block;
}

/* Red border on weak/invalid */
.form-control.input-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.15) !important;
    background: #fff5f5 !important;
}
/* ================================================================
           RESPONSIVE
           ================================================================ */

/* Tablet */
@media (max-width: 768px) {
    body {
        padding: 20px 12px;
    }

    .reg-card {
        padding: 1.6rem 1.4rem;
        border-radius: 20px;
    }

    .reg-title {
        font-size: 1.5rem;
    }

    .reg-subtitle {
        font-size: 0.85rem;
    }
}

/* Mobile portrait */
@media (max-width: 600px) {
    body {
        padding: 12px 8px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .full-width {
        grid-column: auto;
    }

    .reg-card {
        padding: 1.4rem 1.1rem;
        border-radius: 18px;
    }

    .reg-title {
        font-size: 1.35rem;
    }

    .reg-subtitle {
        font-size: 0.8rem;
    }

    .otp-channel {
        gap: 1.2rem;
    }

    .btn {
        min-height: 46px;
        font-size: 0.95rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .reg-card {
        padding: 1.2rem 0.9rem;
    }

    .reg-title {
        font-size: 1.2rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 15px;
    }
}

/* Landscape phones / short screens */
@media (max-height: 700px) and (min-width: 601px) {
    body {
        padding: 15px 12px;
    }

    .reg-card {
        padding: 1.4rem 1.8rem;
    }

    .form-grid {
        gap: 10px 16px;
    }

    .form-group input,
    .form-group select {
        padding: 9px 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}
